diff --git a/Cargo.toml b/Cargo.toml index 7ef70a0bf5..11f215fc15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ ahash = "0.8.6" anyhow = { workspace = true } anymap = "1.0.0-beta.2" base32ct = { version = "0.2.0", features = ["std"] } -base64 = { workspace = true } base-x = "0.2.11" bellpepper = { workspace = true } bellpepper-core = { workspace = true } @@ -119,20 +118,19 @@ members = ["lurk-macros", "lurk-metrics"] [workspace.dependencies] abomonation = "0.7.3" anyhow = "1.0.72" -base64 = "0.13.1" bellpepper = { git = "https://github.com/lurk-lab/bellpepper", branch = "dev" } bellpepper-core = { git = "https://github.com/lurk-lab/bellpepper", branch = "dev" } bincode = "1.3.3" clap = "4.3.17" ff = "0.13" -metrics = "0.21.1" +metrics = "0.22.0" neptune = { git = "https://github.com/lurk-lab/neptune", branch = "dev", features = ["abomonation"] } nova = { git = "https://github.com/lurk-lab/arecibo", branch = "dev", package = "arecibo" } once_cell = "1.18.0" pairing = { version = "0.23" } pasta_curves = { git = "https://github.com/lurk-lab/pasta_curves", branch = "dev" } proptest = "1.2.0" -proptest-derive = "0.3" +proptest-derive = "0.4.0" rand = "0.8" serde = "1.0" serde_json = { version = "1.0" } diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000000..00a38370c4 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,4 @@ +[default] +extend-ignore-identifiers-re = [ + "[Aa]bomonation", +] diff --git a/lurk-metrics/src/lib.rs b/lurk-metrics/src/lib.rs index 0989bb4f0e..d3b1d17023 100644 --- a/lurk-metrics/src/lib.rs +++ b/lurk-metrics/src/lib.rs @@ -77,7 +77,7 @@ impl MetricsSink { }; sink.install(); - metrics::set_recorder(&MetricsRecorder).unwrap(); + metrics::set_global_recorder(MetricsRecorder).unwrap(); handle } @@ -181,19 +181,19 @@ mod tests { let threads = Arc::clone(&sink.threads); sink.install(); - metrics::set_recorder(&MetricsRecorder).unwrap(); - - metrics::counter!("test_counter", 1, "type" => "foo"); - metrics::counter!("test_counter", 1, "type" => "bar"); - metrics::counter!("test_counter", 2, "type" => "foo"); - metrics::counter!("test_counter", 2, "type" => "bar"); - metrics::counter!("test_counter", 3, "type" => "foo"); - metrics::counter!("test_counter", 4, "type" => "bar"); - - metrics::gauge!("test_gauge", 5.0, "type" => "foo"); - metrics::gauge!("test_gauge", 5.0, "type" => "bar"); - metrics::gauge!("test_gauge", 2.0, "type" => "foo"); - metrics::gauge!("test_gauge", 3.0, "type" => "bar"); + metrics::set_global_recorder(MetricsRecorder).unwrap(); + + metrics::counter!("test_counter", "type" => "foo").increment(1); + metrics::counter!("test_counter", "type" => "bar").increment(1); + metrics::counter!("test_counter", "type" => "foo").increment(2); + metrics::counter!("test_counter", "type" => "bar").increment(2); + metrics::counter!("test_counter", "type" => "foo").increment(3); + metrics::counter!("test_counter", "type" => "bar").increment(4); + + metrics::gauge!("test_gauge", "type" => "foo").set(5.0); + metrics::gauge!("test_gauge", "type" => "bar").set(5.0); + metrics::gauge!("test_gauge", "type" => "foo").set(2.0); + metrics::gauge!("test_gauge", "type" => "bar").set(3.0); let metrics = MetricsSink::aggregate(&threads); assert_eq!(metrics.iter().count(), 4); diff --git a/lurk-metrics/src/recorder.rs b/lurk-metrics/src/recorder.rs index 5d7b9ed57c..f3aba8c7a2 100644 --- a/lurk-metrics/src/recorder.rs +++ b/lurk-metrics/src/recorder.rs @@ -1,5 +1,5 @@ use metrics::{ - Counter, CounterFn, Gauge, GaugeFn, Histogram, HistogramFn, Key, KeyName, Recorder, + Counter, CounterFn, Gauge, GaugeFn, Histogram, HistogramFn, Key, KeyName, Metadata, Recorder, SharedString, Unit, }; @@ -18,15 +18,15 @@ impl Recorder for MetricsRecorder { fn describe_histogram(&self, _key: KeyName, _unit: Option, _description: SharedString) {} - fn register_counter(&self, key: &Key) -> Counter { + fn register_counter(&self, key: &Key, _metadata: &Metadata<'_>) -> Counter { Counter::from_arc(Arc::new(CounterImpl(key.clone()))) } - fn register_gauge(&self, key: &Key) -> Gauge { + fn register_gauge(&self, key: &Key, _metadata: &Metadata<'_>) -> Gauge { Gauge::from_arc(Arc::new(GaugeImpl(key.clone()))) } - fn register_histogram(&self, key: &Key) -> Histogram { + fn register_histogram(&self, key: &Key, _metadata: &Metadata<'_>) -> Histogram { Histogram::from_arc(Arc::new(HistogramImpl(key.clone()))) } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1ffa70ccd0..7d67641fa1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] # The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy. profile = "default" -channel = "1.73" +channel = "1.75" targets = [ "wasm32-unknown-unknown" ]