Skip to content

Commit f3ec674

Browse files
thomasballingerConvex, Inc.
authored andcommitted
Metric for transition time Bps (#41367)
GitOrigin-RevId: d6ad56ab36587c5c73d7955694d2e0c570f63869
1 parent 21ce175 commit f3ec674

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

crates/metrics/src/metrics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const ALLOWED_SUFFIXES: &[&str] = &[
5454
"_requests",
5555
"_timeouts",
5656
"_sessions",
57+
"_bytes_per_second",
5758
// Caching units.
5859
"_hits",
5960
"_misses",

crates/sync/src/metrics.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,14 @@ pub fn log_client_transition(partition_id: u64, transition_transit_time: f64, me
413413
partition_id.to_string(),
414414
)],
415415
);
416+
log_distribution_with_labels(
417+
&SYNC_TRANSITION_BYTES_PER_SECOND,
418+
message_length / (transition_transit_time / 1000.0),
419+
vec![StaticMetricLabel::new(
420+
"partition_id",
421+
partition_id.to_string(),
422+
)],
423+
);
416424
}
417425

418426
#[derive(Clone, Debug)]
@@ -493,6 +501,11 @@ register_convex_histogram!(
493501
"Length of transition message from client",
494502
&["partition_id"]
495503
);
504+
register_convex_histogram!(
505+
SYNC_TRANSITION_BYTES_PER_SECOND,
506+
"Length of transition message over server-to-client transit time, from client",
507+
&["partition_id"]
508+
);
496509
register_convex_histogram!(
497510
SYNC_QUERY_INVALIDATION_LAG_SECONDS,
498511
"Time between an invalidating write and a query being rerun",

0 commit comments

Comments
 (0)