Skip to content

Commit

Permalink
test: upgrade mixtrics, add metrics model test
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <mrcroxx@outlook.com>
  • Loading branch information
MrCroxx committed Jan 11, 2025
1 parent 81c7378 commit 9205d72
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ tokio = { package = "madsim-tokio", version = "0.2", features = [
] }
tracing = "0.1"
prometheus = "0.13"
mixtrics = "0.0.1"
mixtrics = "0.0.2"

# foyer components
foyer-common = { version = "0.14.0-dev", path = "foyer-common" }
Expand Down
1 change: 1 addition & 0 deletions foyer-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tokio = { workspace = true }

[dev-dependencies]
futures = "0.3"
mixtrics = { workspace = true, features = ["test-utils"] }
rand = "0.8.5"

[features]
Expand Down
13 changes: 13 additions & 0 deletions foyer-common/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,16 @@ impl Metrics {
Self::new("test", &registry)
}
}

#[cfg(test)]
mod tests {
use mixtrics::metrics::BoxedRegistry;

use super::Metrics;

fn test_fn(registry: &BoxedRegistry) {
Metrics::new("test", registry);
}

mixtrics::test! { test_fn }
}

0 comments on commit 9205d72

Please # to comment.