Skip to content

Commit

Permalink
deps: update histogram, metriken, and ringlog (iopsystems#229)
Browse files Browse the repository at this point in the history
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 stats functions call the percentiles and publish
them using an iterator over the returned vector. Rather
than changing the interface of the wrapper function to
returning null when the histogram is empty, as the histogram
does, it returns an empty vector to metrics callers to
preserve the existing code. Since the empty vector is
iterated over, none of the percentile metrics are published.
  • Loading branch information
mihirn authored Jun 13, 2024
1 parent 87b6f41 commit 5de2d5e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 110 deletions.
140 changes: 36 additions & 104 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ clap = "4.4.6"
foreign-types-shared = "0.3.1"
futures = "0.3.28"
http-body-util = "0.1.0-rc.3"
histogram = "0.10.0"
histogram = "0.11.0"
humantime = "2.1.0"
hyper = { version = "1.0.0-rc.4", features = ["http1", "http2", "client"]}
metriken = "0.6.0"
metriken-exposition = { version = "0.7.0", features = ["json", "parquet-conversion"] }
metriken = "0.7.0"
metriken-exposition = { version = "0.8.0", features = ["json", "parquet-conversion"] }
mio = "0.8.8"
momento = "0.39.7"
pelikan-net = { version = "0.2.0", default-features = false }
pelikan-net = { version = "0.3.0", default-features = false }
once_cell = "1.18.0"
openssl = { version = "0.10.64", optional = true }
openssl-sys = { version = "0.9.102", optional = true }
Expand All @@ -40,7 +40,7 @@ rand_xoshiro = "0.6.0"
ratelimit = "0.9.0"
redis = { version = "0.23.3", features = ["tokio-comp"] }
rdkafka = { version = "0.36.2", features = ["cmake-build", "ssl", "libz", "zstd-pkg-config"] }
ringlog = "0.5.0"
ringlog = "0.7.0"
serde = { version = "1.0.185", features = ["derive"] }
session = { git = "https://github.com/pelikan-io/pelikan" }
sha2 = "0.10.8"
Expand Down
2 changes: 1 addition & 1 deletion src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl HistogramsSnapshot {
.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()));
Expand Down

0 comments on commit 5de2d5e

Please sign in to comment.