Skip to content

Commit

Permalink
feat(s2n-quic-dc): emit basic stream events
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft committed Dec 3, 2024
1 parent 06a004d commit f9ea87d
Show file tree
Hide file tree
Showing 8 changed files with 1,017 additions and 501 deletions.
34 changes: 30 additions & 4 deletions dc/s2n-quic-dc/events/connection.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

#[event("application:write")]
pub struct ApplicationWrite {
#[event("stream:write")]
pub struct StreamWrite {
/// The number of bytes that the application tried to write
#[measure("provided", Bytes)]
total_len: usize,
Expand All @@ -11,10 +11,25 @@ pub struct ApplicationWrite {
#[measure("committed", Bytes)]
#[counter("committed.total", Bytes)]
write_len: usize,

/// The operation was ready to be performed
#[bool_counter("ready")]
ready: bool,
}

#[event("stream:write_shutdown")]
pub struct StreamWriteShutdown {
/// The number of bytes in the send buffer at the time of shutdown
#[measure("buffer_len", Bytes)]
buffer_len: usize,

/// If the stream required a background task to drive the stream shutdown
#[bool_counter("background")]
background: bool,
}

#[event("application:read")]
pub struct ApplicationRead {
#[event("stream:read")]
pub struct StreamRead {
/// The number of bytes that the application tried to read
#[measure("capacity", Bytes)]
capacity: usize,
Expand All @@ -23,4 +38,15 @@ pub struct ApplicationRead {
#[measure("committed", Bytes)]
#[counter("committed.total", Bytes)]
read_len: usize,

/// The operation was ready to be performed
#[bool_counter("ready")]
ready: bool,
}

#[event("stream:read_shutdown")]
pub struct StreamReadShutdown {
/// If the stream required a background task to drive the stream shutdown
#[bool_counter("background")]
background: bool,
}
Loading

0 comments on commit f9ea87d

Please sign in to comment.