1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-09 22:15:15 +03:00

update metrics 0.14 -> 0.15

closes: https://github.com/wez/wezterm/pull/778
This commit is contained in:
Wez Furlong 2021-05-11 19:20:24 -07:00
parent d246ef4cdc
commit a59e9b1706
7 changed files with 38 additions and 20 deletions

21
Cargo.lock generated
View File

@ -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"

View File

@ -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" }

View File

@ -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"]}

View File

@ -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" }

View File

@ -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"

View File

@ -109,32 +109,37 @@ impl Stats {
}
impl Recorder for Stats {
fn register_counter(&self, _key: Key, _unit: Option<Unit>, _description: Option<&'static str>) {
}
fn register_gauge(&self, _key: Key, _unit: Option<Unit>, _description: Option<&'static str>) {}
fn register_histogram(
fn register_counter(
&self,
_key: Key,
_key: &Key,
_unit: Option<Unit>,
_description: Option<&'static str>,
) {
}
fn increment_counter(&self, key: Key, value: u64) {
fn register_gauge(&self, _key: &Key, _unit: Option<Unit>, _description: Option<&'static str>) {}
fn register_histogram(
&self,
_key: &Key,
_unit: Option<Unit>,
_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();
}

View File

@ -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"