diff --git a/Cargo.lock b/Cargo.lock index 798e059ef..da74d5942 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2377,19 +2377,20 @@ dependencies = [ [[package]] name = "metrics" -version = "0.14.2" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e285601dcfb9f3a8f37a7093b9956a0df730b50848c8ac0117406aff06c851" +checksum = "c53c23fff9a59f261498953cf41dc9ffc2522fd79723bdf283c1e88dc1633624" dependencies = [ "metrics-macros", "proc-macro-hack", + "t1ha", ] [[package]] name = "metrics-macros" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ac60cd4d3a869fd39d57baf0ed7f79fb677580d8d6655c4330d4f1126bc27b" +checksum = "b22572ba9964744e261d34553568683b76db277bcd309ebf7215e28e0982505d" dependencies = [ "lazy_static", "proc-macro-hack", @@ -4107,6 +4108,18 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "t1ha" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa44aa51ae1a544e2c35a38831ba54ae40591f21384816f531b84f3e984b9ccc" +dependencies = [ + "cfg-if 0.1.10", + "lazy_static", + "num-traits 0.2.14", + "rustc_version", +] + [[package]] name = "tabout" version = "0.3.0" diff --git a/codec/Cargo.toml b/codec/Cargo.toml index feabe8e8c..69a9d82bc 100644 --- a/codec/Cargo.toml +++ b/codec/Cargo.toml @@ -11,7 +11,7 @@ anyhow = "1.0" config = { path = "../config" } leb128 = "0.2" log = "0.4" -metrics = { version="0.14", features=["std"]} +metrics = { version="0.15", features=["std"]} mux = { path = "../mux" } portable-pty = { path = "../pty", features = ["serde_support"]} rangeset = { path = "../rangeset" } diff --git a/wezterm-client/Cargo.toml b/wezterm-client/Cargo.toml index a2f284f10..0388fed6b 100644 --- a/wezterm-client/Cargo.toml +++ b/wezterm-client/Cargo.toml @@ -16,7 +16,7 @@ filedescriptor = { version="0.7", path = "../filedescriptor" } futures = "0.3" log = "0.4" lru = "0.6" -metrics = { version="0.14", features=["std"]} +metrics = { version="0.15", features=["std"]} mux = { path = "../mux" } openssl = "0.10" portable-pty = { path = "../pty", features = ["serde_support"]} diff --git a/wezterm-font/Cargo.toml b/wezterm-font/Cargo.toml index a166b746f..24d48619c 100644 --- a/wezterm-font/Cargo.toml +++ b/wezterm-font/Cargo.toml @@ -17,7 +17,7 @@ harfbuzz = { path = "../deps/harfbuzz" } lazy_static = "1.4" log = "0.4" memmap2 = "0.2" -metrics = { version="0.14", features=["std"]} +metrics = { version="0.15", features=["std"]} mux = { path = "../mux" } ordered-float = "2.1" rangeset = { path = "../rangeset" } diff --git a/wezterm-gui/Cargo.toml b/wezterm-gui/Cargo.toml index 2ba32ba89..211d918cb 100644 --- a/wezterm-gui/Cargo.toml +++ b/wezterm-gui/Cargo.toml @@ -34,7 +34,7 @@ libc = "0.2" log = "0.4" lru = "0.6" luahelper = { path = "../luahelper" } -metrics = { version="0.14", features=["std"]} +metrics = { version="0.15", features=["std"]} mlua = "0.5" mux = { path = "../mux" } open = "1.4" diff --git a/wezterm-gui/src/stats.rs b/wezterm-gui/src/stats.rs index ddad84584..07010f5e7 100644 --- a/wezterm-gui/src/stats.rs +++ b/wezterm-gui/src/stats.rs @@ -109,32 +109,37 @@ impl Stats { } impl Recorder for Stats { - fn register_counter(&self, _key: Key, _unit: Option, _description: Option<&'static str>) { - } - - fn register_gauge(&self, _key: Key, _unit: Option, _description: Option<&'static str>) {} - - fn register_histogram( + fn register_counter( &self, - _key: Key, + _key: &Key, _unit: Option, _description: Option<&'static str>, ) { } - fn increment_counter(&self, key: Key, value: u64) { + fn register_gauge(&self, _key: &Key, _unit: Option, _description: Option<&'static str>) {} + + fn register_histogram( + &self, + _key: &Key, + _unit: Option, + _description: Option<&'static str>, + ) { + } + + fn increment_counter(&self, key: &Key, value: u64) { log::trace!("counter '{}' -> {}", key, value); } - fn update_gauge(&self, key: Key, value: GaugeValue) { + fn update_gauge(&self, key: &Key, value: GaugeValue) { log::trace!("gauge '{}' -> {:?}", key, value); } - fn record_histogram(&self, key: Key, value: f64) { + fn record_histogram(&self, key: &Key, value: f64) { let mut inner = self.inner.lock().unwrap(); let histogram = inner .histograms - .entry(key) + .entry(key.clone()) .or_insert_with(|| Histogram::new(2).expect("failed to crate new Histogram")); histogram.record(value as u64).ok(); } diff --git a/window/Cargo.toml b/window/Cargo.toml index c05ac0056..372f3aff9 100644 --- a/window/Cargo.toml +++ b/window/Cargo.toml @@ -29,7 +29,7 @@ lazy_static = "1.4" libloading = "0.6" line_drawing = "0.8" log = "0.4" -metrics = { version="0.14", features=["std"]} +metrics = { version="0.15", features=["std"]} promise = { path = "../promise" } raw-window-handle = "0.3" resize = "0.5"