Skip to content

Commit

Permalink
feat: abstract for alternative runtime (GreptimeTeam#3685)
Browse files Browse the repository at this point in the history
  • Loading branch information
ActivePeter committed Sep 28, 2024
1 parent 627a326 commit 6e98474
Show file tree
Hide file tree
Showing 17 changed files with 1,015 additions and 38 deletions.
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4.4", features = ["derive"] }
config = "0.13.0"
crossbeam-utils = "0.8"
clocksource = "0.8.1"
dashmap = "5.4"
datafusion = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
datafusion-common = { git = "https://github.com/waynexia/arrow-datafusion.git", rev = "7823ef2f63663907edab46af0d51359900f608d6" }
Expand Down Expand Up @@ -154,6 +155,7 @@ reqwest = { version = "0.12", default-features = false, features = [
"stream",
"multipart",
] }
parking_lot = "0.12"
rskafka = { git = "https://github.com/influxdata/rskafka.git", rev = "75535b5ad9bae4a5dbb582c82e44dfd81ec10105", features = [
"transport-tls",
] }
Expand Down Expand Up @@ -245,6 +247,7 @@ store-api = { path = "src/store-api" }
substrait = { path = "src/common/substrait" }
table = { path = "src/table" }


[patch.crates-io]
# change all rustls dependencies to use our fork to default to `ring` to make it "just work"
hyper-rustls = { git = "https://github.com/GreptimeTeam/hyper-rustls" }
Expand Down
2 changes: 1 addition & 1 deletion src/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enum_dispatch = "0.3"
futures-util.workspace = true
lazy_static.workspace = true
moka = { workspace = true, features = ["future"] }
parking_lot = "0.12"
parking_lot.workspace = true
prometheus.workspace = true
prost.workspace = true
query.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions src/common/runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test_generate_dir
priority_workload_cpu_usage.json
scripts
7 changes: 7 additions & 0 deletions src/common/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ tokio.workspace = true
tokio-metrics = "0.3"
tokio-metrics-collector = { git = "https://github.com/MichaelScofield/tokio-metrics-collector.git", rev = "89d692d5753d28564a7aac73c6ac5aba22243ba0" }
tokio-util.workspace = true
serde_json.workspace = true
sysinfo.workspace = true
parking_lot.workspace = true
clocksource.workspace = true
rand.workspace = true
pin-project.workspace = true
futures.workspace = true

[dev-dependencies]
tokio-test = "0.4"
5 changes: 5 additions & 0 deletions src/common/runtime/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Run performance test for different priority & workload type

```
cargo test --package common-runtime --lib -- test_metrics::test_all_cpu_usage --nocapture
```
1 change: 1 addition & 0 deletions src/common/runtime/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use once_cell::sync::Lazy;
use paste::paste;
use serde::{Deserialize, Serialize};

use crate::runtime::{BuilderBuild, RuntimeTrait};
use crate::{Builder, JoinHandle, Runtime};

const GLOBAL_WORKERS: usize = 8;
Expand Down
5 changes: 5 additions & 0 deletions src/common/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
pub mod error;
pub mod global;
mod metrics;
mod ratelimit;
mod repeated_task;
pub mod runtime;
mod runtime_default;
#[cfg(test)]
mod test_metrics;
mod throttle_priority;

pub use global::{
block_on_compact, block_on_global, compact_runtime, create_runtime, global_runtime,
Expand Down
Loading

0 comments on commit 6e98474

Please sign in to comment.