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 4a8b94c
Show file tree
Hide file tree
Showing 8 changed files with 1,105 additions and 497 deletions.
49 changes: 45 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,34 @@ pub struct ApplicationWrite {
#[measure("committed", Bytes)]
#[counter("committed.total", Bytes)]
write_len: usize,

#[bool_counter("is_fin")]
is_fin: bool,

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

/// The amount of time it took to process the write request
///
/// Note that this includes both any syscall and encryption overhead
#[measure("processing_duration", Duration)]
processing_duration: core::time::Duration,
}

#[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 +47,21 @@ pub struct ApplicationRead {
#[measure("committed", Bytes)]
#[counter("committed.total", Bytes)]
read_len: usize,

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

/// The amount of time it took to process the read request
///
/// Note that this includes both any syscall and decryption overhead
#[measure("processing_duration", Duration)]
processing_duration: core::time::Duration,
}

#[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 4a8b94c

Please sign in to comment.