Skip to content

Percentile latencies#368

Merged
gabotechs merged 6 commits intomainfrom
percentile-latency
Mar 12, 2026
Merged

Percentile latencies#368
gabotechs merged 6 commits intomainfrom
percentile-latency

Conversation

@gabotechs
Copy link
Collaborator

Adds some percentile latency metrics that are more suitable for observing network latencies.

@gabotechs gabotechs force-pushed the percentile-latency branch from 8cca7a6 to 5649552 Compare March 11, 2026 14:39
@gabotechs gabotechs force-pushed the percentile-latency branch from fe878d0 to fa282f3 Compare March 11, 2026 16:28
($name:ident, $percentile:expr) => {
#[derive(Clone)]
pub struct $name {
inner: Arc<Mutex<DDSketch>>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love having a mutex here, but I've created some microbenchmarks in a separate branch (that I don't think are worth committing to the repo) to make sure this is the fastest approach vs other options like Atomic-based time buckets, and it actually is, so keeping this.

Copy link
Collaborator

@jayshrivastava jayshrivastava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`

let max_latency = MetricBuilder::new(metrics).max_latency("network_latency_max");
let avg_latency = MetricBuilder::new(metrics).avg_latency("network_latency_avg");
let p50_latency = MetricBuilder::new(metrics).avg_latency("network_latency_p50");
let p95_latency = MetricBuilder::new(metrics).avg_latency("network_latency_p95");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo. These should be p50_latency and p95_latency

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shit

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now, thanks!

@gabotechs gabotechs merged commit 75a8d02 into main Mar 12, 2026
7 checks passed
@gabotechs gabotechs deleted the percentile-latency branch March 12, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants