From b0e2f86d6b2866759a8edcd316734d8ea043b145 Mon Sep 17 00:00:00 2001 From: Mihir Nanavati Date: Wed, 12 Jun 2024 22:06:11 +0530 Subject: [PATCH] deps: update histogram, metriken, and ringlog Update dependencies to move towards a single version of histogram (0.11.0) and metriken (0.7.0). This is a breaking change in the interface of calls to percentile functions, which can now return null when the histogram is empty. The metrics functions call the percentiles and publish them using an iterator over them. Rather than changing the interface of the wrapper function to returning null when the histogram is empty, it returns an empty vector to metrics callers, which prevents them from publishing percentile metrics. --- Cargo.lock | 160 ++++++++-------------------- Cargo.toml | 6 +- src/net/Cargo.toml | 2 +- src/protocol/admin/src/snapshots.rs | 2 +- 4 files changed, 52 insertions(+), 118 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aef8f4c1..d6906623 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ dependencies = [ "entrystore", "libc", "logger", - "metriken 0.6.0", + "metriken", "parking_lot", "pelikan-net", "protocol-admin", @@ -163,7 +163,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -174,7 +174,7 @@ checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -282,7 +282,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.58", + "syn", ] [[package]] @@ -515,7 +515,7 @@ version = "0.3.1" dependencies = [ "boring", "clocksource", - "metriken 0.6.0", + "metriken", "pelikan-net", "ringlog", "serde", @@ -733,7 +733,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -826,7 +826,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -931,18 +931,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "histogram" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b634390eb8a63662e127836d4e2f26d7ae930600d4e05ee0fd85a009eeb1175" -dependencies = [ - "thiserror", -] - -[[package]] -name = "histogram" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe0e7d1b57c929216545b6aa17aff4798bc432b7065ac16a3e03b8dd63d8643" +checksum = "b62b8d85713ddc62e5e78db13bf9f9305610d0419276faa845076a68b7165872" dependencies = [ "thiserror", ] @@ -1149,7 +1140,7 @@ checksum = "adf157a4dc5a29b7b464aa8fe7edeff30076e07e13646a1c3874f58477dc99f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1206,26 +1197,13 @@ dependencies = [ [[package]] name = "metriken" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3870ac33c736eb72b163e299d3942ddf8faf78600768ac13973d240593eedf" -dependencies = [ - "histogram 0.9.1", - "metriken-core", - "metriken-derive 0.4.1", - "once_cell", - "parking_lot", -] - -[[package]] -name = "metriken" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0bad9aa443621ae4972578da55b7f3c24d930cc1491551a8f989edead4762c" +checksum = "0fc160a09cad0d921ac6d6a6fe45a31f7f709b5c312afa97d58c637c7add0be9" dependencies = [ - "histogram 0.10.2", + "histogram", "metriken-core", - "metriken-derive 0.5.1", + "metriken-derive", "once_cell", "parking_lot", ] @@ -1241,28 +1219,16 @@ dependencies = [ "phf", ] -[[package]] -name = "metriken-derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb49028ecd37be8a53476b35d5b0bb6647e304d9b9c6836e9a5ba9efa13e1dcf" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "metriken-derive" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3643374c9873e69a27e50404db6006ad09f0c1ee944e8ce928d586df077b71db" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1346,7 +1312,7 @@ dependencies = [ "config", "libc", "logger", - "metriken 0.6.0", + "metriken", "momento", "pelikan-net", "protocol-admin", @@ -1463,7 +1429,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1525,14 +1491,14 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pelikan-net" -version = "0.2.0" +version = "0.3.0" dependencies = [ "boring", "boring-sys", "foreign-types-shared 0.1.1", "foreign-types-shared 0.3.1", "libc", - "metriken 0.6.0", + "metriken", "mio", "openssl", "openssl-sys", @@ -1549,7 +1515,7 @@ dependencies = [ "criterion", "entrystore", "logger", - "metriken 0.6.0", + "metriken", "protocol-memcache", "server", ] @@ -1599,7 +1565,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1628,7 +1594,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1652,7 +1618,7 @@ dependencies = [ "common", "config", "logger", - "metriken 0.6.0", + "metriken", "protocol-ping", "proxy", ] @@ -1668,7 +1634,7 @@ dependencies = [ "criterion", "entrystore", "logger", - "metriken 0.6.0", + "metriken", "protocol-ping", "server", ] @@ -1719,16 +1685,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -1767,7 +1723,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1778,7 +1734,7 @@ dependencies = [ "config", "criterion", "logger", - "metriken 0.6.0", + "metriken", "parking_lot", "protocol-common", "storage-types", @@ -1820,7 +1776,7 @@ dependencies = [ "common", "criterion", "logger", - "metriken 0.6.0", + "metriken", "nom", "protocol-common", ] @@ -1833,7 +1789,7 @@ dependencies = [ "config", "criterion", "logger", - "metriken 0.6.0", + "metriken", "protocol-common", "storage-types", ] @@ -1846,7 +1802,7 @@ dependencies = [ "common", "logger", "memchr", - "metriken 0.6.0", + "metriken", "nom", "protocol-common", "thiserror", @@ -1858,7 +1814,7 @@ version = "0.3.1" dependencies = [ "common", "logger", - "metriken 0.6.0", + "metriken", "protocol-common", ] @@ -1873,7 +1829,7 @@ dependencies = [ "crossbeam-channel", "entrystore", "logger", - "metriken 0.6.0", + "metriken", "pelikan-net", "protocol-admin", "protocol-common", @@ -1967,7 +1923,7 @@ dependencies = [ "criterion", "entrystore", "logger", - "metriken 0.6.0", + "metriken", "protocol-resp", "server", ] @@ -2042,14 +1998,14 @@ dependencies = [ [[package]] name = "ringlog" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5511da5e98075dcee60b32425c64a01c5949f0d4bc7697f282544b037753a492" +checksum = "db07537a2d45e51cd77393ca2f04b6e4e47f43b695c644e5415210931ef1600a" dependencies = [ "ahash", "clocksource", "log", - "metriken 0.4.2", + "metriken", "mpmc", ] @@ -2199,7 +2155,7 @@ dependencies = [ "criterion", "datatier", "log", - "metriken 0.6.0", + "metriken", "rand", "rand_chacha", "rand_xoshiro", @@ -2223,7 +2179,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2257,7 +2213,7 @@ dependencies = [ "entrystore", "libc", "logger", - "metriken 0.6.0", + "metriken", "pelikan-net", "protocol-admin", "protocol-common", @@ -2275,7 +2231,7 @@ dependencies = [ "clocksource", "common", "log", - "metriken 0.6.0", + "metriken", "pelikan-net", "protocol-common", ] @@ -2388,17 +2344,6 @@ dependencies = [ "rand_chacha", ] -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.58" @@ -2451,7 +2396,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2463,7 +2408,7 @@ dependencies = [ "common", "config", "logger", - "metriken 0.6.0", + "metriken", "protocol-thrift", "proxy", ] @@ -2558,7 +2503,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2617,17 +2562,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -2735,7 +2669,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2851,7 +2785,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn", "wasm-bindgen-shared", ] @@ -2873,7 +2807,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3107,7 +3041,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 22ec5a9e..7aab1af0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,21 +55,21 @@ httparse = "1.8.0" libc = "0.2.149" log = "0.4.20" memmap2 = "0.9.0" -metriken = "0.6.0" +metriken = "0.7.0" metrohash = "1.0.6" mio = "0.8.11" nom = "7.1.3" openssl = "0.10.64" openssl-sys = "0.9.102" parking_lot = "0.12.1" -pelikan-net = { path = "./src/net", version = "0.2.0", default-features = false } +pelikan-net = { path = "./src/net", version = "0.3.0", default-features = false } phf = "0.11.2" proc-macro2 = "1.0.69" quote = "1.0.33" rand = "0.8.5" rand_chacha = "0.3.1" rand_xoshiro = "0.6.0" -ringlog = "0.5.0" +ringlog = "0.7.0" serde = "1.0.189" serde_json = "1.0.107" signal-hook = "0.3.17" diff --git a/src/net/Cargo.toml b/src/net/Cargo.toml index cbaea76f..b2fb0da5 100644 --- a/src/net/Cargo.toml +++ b/src/net/Cargo.toml @@ -2,7 +2,7 @@ name = "pelikan-net" description = "Pelikan project's networking abstractions for non-blocking event loops" authors = ["Brian Martin "] -version = "0.2.0" +version = "0.3.0" edition = { workspace = true } homepage = { workspace = true } diff --git a/src/protocol/admin/src/snapshots.rs b/src/protocol/admin/src/snapshots.rs index 53cd0367..3ab4ed78 100644 --- a/src/protocol/admin/src/snapshots.rs +++ b/src/protocol/admin/src/snapshots.rs @@ -105,7 +105,7 @@ impl Snapshots { .collect(); if let Some(snapshot) = self.deltas.get(metric) { - if let Ok(percentiles) = snapshot.percentiles(&percentiles) { + if let Ok(Some(percentiles)) = snapshot.percentiles(&percentiles) { for ((label, _), (percentile, bucket)) in PERCENTILES.iter().zip(percentiles.iter()) { result.push((label.to_string(), *percentile, bucket.end()));