add metrics on throttled streams (#34579)
This commit is contained in:
parent
cc584a0c19
commit
1a001751dd
|
@ -742,6 +742,7 @@ async fn handle_connection(
|
||||||
if reset_throttling_params_if_needed(&mut last_throttling_instant) {
|
if reset_throttling_params_if_needed(&mut last_throttling_instant) {
|
||||||
streams_in_current_interval = 0;
|
streams_in_current_interval = 0;
|
||||||
} else if streams_in_current_interval >= max_streams_per_100ms {
|
} else if streams_in_current_interval >= max_streams_per_100ms {
|
||||||
|
stats.throttled_streams.fetch_add(1, Ordering::Relaxed);
|
||||||
let _ = stream.stop(VarInt::from_u32(STREAM_STOP_CODE_THROTTLING));
|
let _ = stream.stop(VarInt::from_u32(STREAM_STOP_CODE_THROTTLING));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,6 +175,7 @@ pub struct StreamStats {
|
||||||
pub(crate) connection_setup_error_locally_closed: AtomicUsize,
|
pub(crate) connection_setup_error_locally_closed: AtomicUsize,
|
||||||
pub(crate) connection_removed: AtomicUsize,
|
pub(crate) connection_removed: AtomicUsize,
|
||||||
pub(crate) connection_remove_failed: AtomicUsize,
|
pub(crate) connection_remove_failed: AtomicUsize,
|
||||||
|
pub(crate) throttled_streams: AtomicUsize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StreamStats {
|
impl StreamStats {
|
||||||
|
@ -405,6 +406,11 @@ impl StreamStats {
|
||||||
self.total_stream_read_timeouts.swap(0, Ordering::Relaxed),
|
self.total_stream_read_timeouts.swap(0, Ordering::Relaxed),
|
||||||
i64
|
i64
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"throttled_streams",
|
||||||
|
self.throttled_streams.swap(0, Ordering::Relaxed),
|
||||||
|
i64
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue