diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe8163a4..e93a9ce8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,7 +164,7 @@ jobs: run: | cargo clippy --all-targets --features tokio-console -- -D warnings cargo clippy --all-targets --features deadlock -- -D warnings - cargo clippy --all-targets --features mtrace -- -D warnings + cargo clippy --all-targets --features tracing -- -D warnings cargo clippy --all-targets -- -D warnings - if: steps.cache.outputs.cache-hit != 'true' uses: taiki-e/install-action@cargo-llvm-cov @@ -191,8 +191,8 @@ jobs: cargo llvm-cov --no-report run --example hybrid cargo llvm-cov --no-report run --example hybrid_full cargo llvm-cov --no-report run --example event_listener - cargo llvm-cov --no-report run --features "mtrace,jaeger" --example tail_based_tracing - cargo llvm-cov --no-report run --features "mtrace,ot" --example tail_based_tracing + cargo llvm-cov --no-report run --features "tracing,jaeger" --example tail_based_tracing + cargo llvm-cov --no-report run --features "tracing,ot" --example tail_based_tracing - name: Run foyer-bench with coverage if: runner.os == 'Linux' env: diff --git a/Cargo.toml b/Cargo.toml index 9878fe54..90be98e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,7 @@ fastrace-jaeger = "0.7" fastrace-opentelemetry = "0.7" clap = { version = "4", features = ["derive"] } bytesize = { package = "foyer-bytesize", version = "2" } +hashbrown = "0.15" # foyer components foyer-common = { version = "0.12.0-dev", path = "foyer-common" } foyer-intrusive = { version = "0.12.0-dev", path = "foyer-intrusive" } @@ -52,5 +53,8 @@ foyer-memory = { version = "0.12.0-dev", path = "foyer-memory" } foyer-storage = { version = "0.12.0-dev", path = "foyer-storage" } foyer = { version = "0.12.0-dev", path = "foyer" } +[workspace.lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(madsim)'] } + [profile.release] debug = "full" diff --git a/Makefile b/Makefile index 0c9c6fd6..d536f2ec 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ check-all: cargo clippy --all-targets --features deadlock cargo clippy --all-targets --features tokio-console cargo clippy --all-targets --features sanity - cargo clippy --all-targets --features mtrace + cargo clippy --all-targets --features tracing cargo clippy --all-targets test: @@ -42,8 +42,8 @@ example: cargo run --example hybrid cargo run --example hybrid_full cargo run --example event_listener - cargo run --features "mtrace,jaeger" --example tail_based_tracing - cargo run --features "mtrace,ot" --example tail_based_tracing + cargo run --features "tracing,jaeger" --example tail_based_tracing + cargo run --features "tracing,ot" --example tail_based_tracing full: check-all test-all example udeps diff --git a/examples/tail_based_tracing.rs b/examples/tail_based_tracing.rs index 6bfbba98..0d515091 100644 --- a/examples/tail_based_tracing.rs +++ b/examples/tail_based_tracing.rs @@ -61,7 +61,7 @@ fn init_exporter() { panic!("Either jaeger or opentelemetry feature must be enabled!"); } -/// NOTE: To run this example, please enable feature "mtrace" and either "jaeger" or "ot". +/// NOTE: To run this example, please enable feature "tracing" and either "jaeger" or "ot". #[tokio::main] async fn main() -> anyhow::Result<()> { init_exporter(); diff --git a/foyer-bench/Cargo.toml b/foyer-bench/Cargo.toml index 1f535370..d942e473 100644 --- a/foyer-bench/Cargo.toml +++ b/foyer-bench/Cargo.toml @@ -41,9 +41,9 @@ tikv-jemallocator = { version = "0.6", optional = true } [features] default = ["jemalloc"] deadlock = ["parking_lot/deadlock_detection", "foyer/deadlock"] -tokio-console = ["console-subscriber"] +tokio-console = ["dep:console-subscriber"] strict_assertions = ["foyer/strict_assertions"] sanity = ["foyer/sanity"] -jemalloc = ["tikv-jemallocator"] -jeprof = ["jemalloc", "tikv-jemallocator/profiling"] -mtrace = ["foyer/mtrace", "fastrace-jaeger", "fastrace"] +jemalloc = ["dep:tikv-jemallocator"] +jeprof = ["jemalloc", "tikv-jemallocator?/profiling"] +tracing = ["foyer/tracing", "dep:fastrace-jaeger", "dep:fastrace"] diff --git a/foyer-bench/src/main.rs b/foyer-bench/src/main.rs index 5cd639e1..bbe52904 100644 --- a/foyer-bench/src/main.rs +++ b/foyer-bench/src/main.rs @@ -244,19 +244,19 @@ pub struct Args { #[arg(long, default_value_t = 64)] set_cache_capacity: usize, - /// Record insert trace threshold. Only effective with "mtrace" feature. + /// Record insert trace threshold. Only effective with "tracing" feature. #[arg(long, default_value_t = 1000 * 1000)] trace_insert_us: usize, - /// Record get trace threshold. Only effective with "mtrace" feature. + /// Record get trace threshold. Only effective with "tracing" feature. #[arg(long, default_value_t = 1000 * 1000)] trace_get_us: usize, - /// Record obtain trace threshold. Only effective with "mtrace" feature. + /// Record obtain trace threshold. Only effective with "tracing" feature. #[arg(long, default_value_t = 1000 * 1000)] trace_obtain_us: usize, - /// Record remove trace threshold. Only effective with "mtrace" feature. + /// Record remove trace threshold. Only effective with "tracing" feature. #[arg(long, default_value_t = 1000 * 1000)] trace_remove_us: usize, - /// Record fetch trace threshold. Only effective with "mtrace" feature. + /// Record fetch trace threshold. Only effective with "tracing" feature. #[arg(long, default_value_t = 1000 * 1000)] trace_fetch_us: usize, } @@ -350,14 +350,14 @@ fn setup() { console_subscriber::init(); } -#[cfg(feature = "mtrace")] +#[cfg(feature = "tracing")] fn setup() { use fastrace::collector::Config; let reporter = fastrace_jaeger::JaegerReporter::new("127.0.0.1:6831".parse().unwrap(), "foyer-bench").unwrap(); fastrace::set_reporter(reporter, Config::default().report_interval(Duration::from_millis(1))); } -#[cfg(not(any(feature = "tokio-console", feature = "mtrace")))] +#[cfg(not(any(feature = "tokio-console", feature = "tracing")))] fn setup() { use tracing_subscriber::{prelude::*, EnvFilter}; @@ -371,10 +371,10 @@ fn setup() { .init(); } -#[cfg(not(any(feature = "mtrace")))] +#[cfg(not(any(feature = "tracing")))] fn teardown() {} -#[cfg(feature = "mtrace")] +#[cfg(feature = "tracing")] fn teardown() { fastrace::flush(); } @@ -532,7 +532,7 @@ async fn benchmark(args: Args) { .await .unwrap(); - #[cfg(feature = "mtrace")] + #[cfg(feature = "tracing")] hybrid.enable_tracing(); let stats = hybrid.stats(); diff --git a/foyer-common/Cargo.toml b/foyer-common/Cargo.toml index c416d6cd..5eee4d06 100644 --- a/foyer-common/Cargo.toml +++ b/foyer-common/Cargo.toml @@ -18,7 +18,7 @@ cfg-if = "1" crossbeam = "0.8" fastrace = { workspace = true } futures = "0.3" -hashbrown = "0.14" +hashbrown = { workspace = true } itertools = { workspace = true } metrics = { workspace = true } parking_lot = { version = "0.12", features = ["arc_lock"] } @@ -32,7 +32,7 @@ rand = "0.8.5" [features] strict_assertions = [] -mtrace = ["fastrace/enable"] +tracing = ["fastrace/enable"] -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(madsim)'] } +[lints] +workspace = true diff --git a/foyer-memory/Cargo.toml b/foyer-memory/Cargo.toml index 078fbe72..914d315c 100644 --- a/foyer-memory/Cargo.toml +++ b/foyer-memory/Cargo.toml @@ -20,7 +20,7 @@ fastrace = { workspace = true } foyer-common = { workspace = true } foyer-intrusive = { workspace = true } futures = "0.3" -hashbrown = "0.14" +hashbrown = { workspace = true } itertools = { workspace = true } parking_lot = "0.12" pin-project = "1" @@ -43,7 +43,7 @@ strict_assertions = [ "foyer-intrusive/strict_assertions", ] sanity = ["strict_assertions"] -mtrace = ["fastrace/enable", "foyer-common/mtrace"] +tracing = ["fastrace/enable", "foyer-common/tracing"] [[bench]] name = "bench_hit_ratio" diff --git a/foyer-storage/Cargo.toml b/foyer-storage/Cargo.toml index e0b85011..326fb17c 100644 --- a/foyer-storage/Cargo.toml +++ b/foyer-storage/Cargo.toml @@ -32,6 +32,7 @@ foyer-common = { workspace = true } foyer-memory = { workspace = true } fs4 = "0.9.1" futures = "0.3" +hashbrown = { workspace = true } itertools = { workspace = true } libc = "0.2" lz4 = "1.24" @@ -60,7 +61,7 @@ strict_assertions = [ "foyer-common/strict_assertions", "foyer-memory/strict_assertions", ] -mtrace = ["fastrace/enable", "foyer-common/mtrace", "foyer-memory/mtrace"] +tracing = ["fastrace/enable", "foyer-common/tracing", "foyer-memory/tracing"] -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(madsim)'] } +[lints] +workspace = true diff --git a/foyer-util/Cargo.toml b/foyer-util/Cargo.toml index ab381677..1b485ee4 100644 --- a/foyer-util/Cargo.toml +++ b/foyer-util/Cargo.toml @@ -20,7 +20,7 @@ bytes = "1" cfg-if = "1" foyer-common = { workspace = true } futures = "0.3" -hashbrown = "0.14" +hashbrown = { workspace = true } itertools = { workspace = true } parking_lot = { version = "0.12", features = ["arc_lock"] } serde = { workspace = true } diff --git a/foyer/Cargo.toml b/foyer/Cargo.toml index c9eb989b..aad21ea8 100644 --- a/foyer/Cargo.toml +++ b/foyer/Cargo.toml @@ -38,9 +38,9 @@ strict_assertions = [ "foyer-storage/strict_assertions", ] sanity = ["strict_assertions", "foyer-memory/sanity"] -mtrace = [ +tracing = [ "fastrace/enable", - "foyer-common/mtrace", - "foyer-memory/mtrace", - "foyer-storage/mtrace", + "foyer-common/tracing", + "foyer-memory/tracing", + "foyer-storage/tracing", ]