Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show staked vs nonstaked packets sent down/throttled #600

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,18 @@ async fn handle_connection(
>= max_streams_per_throttling_interval
{
stats.throttled_streams.fetch_add(1, Ordering::Relaxed);
match params.peer_type {
ConnectionPeerType::Unstaked => {
stats
.throttled_unstaked_streams
.fetch_add(1, Ordering::Relaxed);
}
ConnectionPeerType::Staked(_) => {
stats
.throttled_staked_streams
.fetch_add(1, Ordering::Relaxed);
}
}
let _ = stream.stop(VarInt::from_u32(STREAM_STOP_CODE_THROTTLING));
continue;
}
Expand Down Expand Up @@ -963,6 +975,19 @@ async fn handle_chunk(
.total_chunks_sent_for_batching
.fetch_add(chunks_sent, Ordering::Relaxed);

match peer_type {
ConnectionPeerType::Unstaked => {
stats
.total_unstaked_packets_sent_for_batching
.fetch_add(1, Ordering::Relaxed);
}
ConnectionPeerType::Staked(_) => {
stats
.total_staked_packets_sent_for_batching
.fetch_add(1, Ordering::Relaxed);
}
}

trace!("sent {} byte packet for batching", bytes_sent);
}
} else {
Expand Down
26 changes: 26 additions & 0 deletions streamer/src/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ pub struct StreamStats {
pub(crate) stream_load_capacity_overflow: AtomicUsize,
pub(crate) process_sampled_packets_us_hist: Mutex<histogram::Histogram>,
pub(crate) perf_track_overhead_us: AtomicU64,
pub(crate) total_staked_packets_sent_for_batching: AtomicUsize,
pub(crate) total_unstaked_packets_sent_for_batching: AtomicUsize,
pub(crate) throttled_staked_streams: AtomicUsize,
pub(crate) throttled_unstaked_streams: AtomicUsize,
Comment on lines +180 to +183
Copy link

Choose a reason for hiding this comment

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

Change looks good to me; should we deprecate total_packets_sent_for_batching and throttled_streams; both of these can now be implied by adding unstaked + staked

Copy link
Author

Choose a reason for hiding this comment

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

I think it is okay to leave it alone for convenience in doing Grafana.

}

impl StreamStats {
Expand Down Expand Up @@ -338,6 +342,18 @@ impl StreamStats {
.swap(0, Ordering::Relaxed),
i64
),
(
"staked_packets_sent_for_batching",
self.total_staked_packets_sent_for_batching
.swap(0, Ordering::Relaxed),
i64
),
(
"unstaked_packets_sent_for_batching",
self.total_unstaked_packets_sent_for_batching
.swap(0, Ordering::Relaxed),
i64
),
(
"bytes_sent_for_batching",
self.total_bytes_sent_for_batching
Expand Down Expand Up @@ -434,6 +450,16 @@ impl StreamStats {
self.stream_load_capacity_overflow.load(Ordering::Relaxed),
i64
),
(
"throttled_unstaked_streams",
self.throttled_unstaked_streams.swap(0, Ordering::Relaxed),
i64
),
(
"throttled_staked_streams",
self.throttled_staked_streams.swap(0, Ordering::Relaxed),
i64
),
(
"process_sampled_packets_us_90pct",
process_sampled_packets_us_hist
Expand Down
Loading