From e3337a5a067414cb98f5397e30087ffbaf76aecd Mon Sep 17 00:00:00 2001 From: Cameron Bytheway Date: Mon, 2 Dec 2024 17:28:36 -0700 Subject: [PATCH] feat(s2n-quic-dc): emit basic stream events --- dc/s2n-quic-dc/events/connection.rs | 193 +- dc/s2n-quic-dc/src/event/generated.rs | 1932 +++++++++++++++-- dc/s2n-quic-dc/src/event/generated/metrics.rs | 250 ++- .../src/event/generated/metrics/aggregate.rs | 1154 +++++++--- .../src/event/generated/metrics/probe.rs | 322 ++- dc/s2n-quic-dc/src/stream/endpoint.rs | 6 +- dc/s2n-quic-dc/src/stream/recv/application.rs | 80 +- dc/s2n-quic-dc/src/stream/recv/shared.rs | 72 +- dc/s2n-quic-dc/src/stream/recv/worker.rs | 7 +- dc/s2n-quic-dc/src/stream/send/application.rs | 87 +- dc/s2n-quic-dc/src/stream/send/queue.rs | 141 +- dc/s2n-quic-dc/src/stream/send/worker.rs | 2 + dc/s2n-quic-dc/src/stream/shared.rs | 45 +- 13 files changed, 3662 insertions(+), 629 deletions(-) diff --git a/dc/s2n-quic-dc/events/connection.rs b/dc/s2n-quic-dc/events/connection.rs index b64624c86..9ee63aec7 100644 --- a/dc/s2n-quic-dc/events/connection.rs +++ b/dc/s2n-quic-dc/events/connection.rs @@ -1,20 +1,120 @@ // 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_flushed")] +pub struct StreamWriteFlushed { /// The number of bytes that the application tried to write #[measure("provided", Bytes)] - total_len: usize, + provided_len: usize, /// The amount that was written #[measure("committed", Bytes)] #[counter("committed.total", Bytes)] - write_len: usize, + committed_len: usize, + + #[bool_counter("is_fin")] + is_fin: 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_blocked")] +pub struct StreamWriteBlocked { + /// The number of bytes that the application tried to write + #[measure("provided", Bytes)] + provided_len: usize, + + #[bool_counter("is_fin")] + is_fin: 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("application:read")] -pub struct ApplicationRead { +#[event("stream:write_errored")] +pub struct StreamWriteErrored { + /// The number of bytes that the application tried to write + #[measure("provided", Bytes)] + provided_len: usize, + + #[bool_counter("is_fin")] + is_fin: 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, + + /// The system `errno` from the returned error + errno: Option, +} + +#[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("stream:write_socket_flushed")] +pub struct StreamWriteSocketFlushed { + /// The number of bytes that the application tried to write + #[measure("provided", Bytes)] + provided_len: usize, + + /// The amount that was written + #[measure("committed", Bytes)] + #[counter("committed.total", Bytes)] + committed_len: usize, + + /// 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_socket_blocked")] +pub struct StreamWriteSocketBlocked { + /// The number of bytes that the application tried to write + #[measure("provided", Bytes)] + provided_len: usize, + + /// 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_socket_errored")] +pub struct StreamWriteSocketErrored { + /// The number of bytes that the application tried to write + #[measure("provided", Bytes)] + provided_len: usize, + + /// The amount of time it took to process the write request + #[measure("processing_duration", Duration)] + processing_duration: core::time::Duration, + + /// The system `errno` from the returned error + errno: Option, +} + +#[event("stream:read_flushed")] +pub struct StreamReadFlushed { /// The number of bytes that the application tried to read #[measure("capacity", Bytes)] capacity: usize, @@ -22,5 +122,84 @@ pub struct ApplicationRead { /// The amount that was read #[measure("committed", Bytes)] #[counter("committed.total", Bytes)] - read_len: usize, + committed_len: usize, + + /// 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_blocked")] +pub struct StreamReadBlocked { + /// The number of bytes that the application tried to read + #[measure("capacity", Bytes)] + capacity: usize, + + /// 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_errored")] +pub struct StreamReadErrored { + /// The number of bytes that the application tried to read + #[measure("capacity", Bytes)] + capacity: usize, + + /// 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, + + /// The system `errno` from the returned error + errno: Option, +} + +#[event("stream:read_shutdown")] +pub struct StreamReadShutdown { + /// If the stream required a background task to drive the stream shutdown + #[bool_counter("background")] + background: bool, +} + +#[event("stream:read_socket_flushed")] +pub struct StreamReadSocketFlushed { + #[measure("capacity", Bytes)] + capacity: usize, + + #[measure("committed", Bytes)] + #[counter("committed.total", Bytes)] + committed_len: usize, + + /// The amount of time it took to process the read request + #[measure("processing_duration", Duration)] + processing_duration: core::time::Duration, +} + +#[event("stream:read_socket_blocked")] +pub struct StreamReadSocketBlocked { + #[measure("capacity", Bytes)] + capacity: usize, + + /// The amount of time it took to process the read request + #[measure("processing_duration", Duration)] + processing_duration: core::time::Duration, +} + +#[event("stream:read_socket_errored")] +pub struct StreamReadSocketErrored { + #[measure("capacity", Bytes)] + capacity: usize, + + /// The amount of time it took to process the read request + #[measure("processing_duration", Duration)] + processing_duration: core::time::Duration, + + /// The system `errno` from the returned error + errno: Option, } diff --git a/dc/s2n-quic-dc/src/event/generated.rs b/dc/s2n-quic-dc/src/event/generated.rs index d64c8cebd..a6eca1d0d 100644 --- a/dc/s2n-quic-dc/src/event/generated.rs +++ b/dc/s2n-quic-dc/src/event/generated.rs @@ -616,43 +616,322 @@ pub mod api { } #[derive(Clone, Debug)] #[non_exhaustive] - pub struct ApplicationWrite { + pub struct StreamWriteFlushed { #[doc = " The number of bytes that the application tried to write"] - pub total_len: usize, + pub provided_len: usize, #[doc = " The amount that was written"] - pub write_len: usize, + pub committed_len: usize, + pub is_fin: bool, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamWriteFlushed { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamWriteFlushed"); + fmt.field("provided_len", &self.provided_len); + fmt.field("committed_len", &self.committed_len); + fmt.field("is_fin", &self.is_fin); + fmt.field("processing_duration", &self.processing_duration); + fmt.finish() + } + } + impl Event for StreamWriteFlushed { + const NAME: &'static str = "stream:write_flushed"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamWriteBlocked { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, + pub is_fin: bool, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamWriteBlocked { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamWriteBlocked"); + fmt.field("provided_len", &self.provided_len); + fmt.field("is_fin", &self.is_fin); + fmt.field("processing_duration", &self.processing_duration); + fmt.finish() + } + } + impl Event for StreamWriteBlocked { + const NAME: &'static str = "stream:write_blocked"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamWriteErrored { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, + pub is_fin: bool, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + #[doc = " The system `errno` from the returned error"] + pub errno: Option, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamWriteErrored { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamWriteErrored"); + fmt.field("provided_len", &self.provided_len); + fmt.field("is_fin", &self.is_fin); + fmt.field("processing_duration", &self.processing_duration); + fmt.field("errno", &self.errno); + fmt.finish() + } + } + impl Event for StreamWriteErrored { + const NAME: &'static str = "stream:write_errored"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamWriteShutdown { + #[doc = " The number of bytes in the send buffer at the time of shutdown"] + pub buffer_len: usize, + #[doc = " If the stream required a background task to drive the stream shutdown"] + pub background: bool, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamWriteShutdown { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamWriteShutdown"); + fmt.field("buffer_len", &self.buffer_len); + fmt.field("background", &self.background); + fmt.finish() + } + } + impl Event for StreamWriteShutdown { + const NAME: &'static str = "stream:write_shutdown"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamWriteSocketFlushed { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, + #[doc = " The amount that was written"] + pub committed_len: usize, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamWriteSocketFlushed { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamWriteSocketFlushed"); + fmt.field("provided_len", &self.provided_len); + fmt.field("committed_len", &self.committed_len); + fmt.field("processing_duration", &self.processing_duration); + fmt.finish() + } + } + impl Event for StreamWriteSocketFlushed { + const NAME: &'static str = "stream:write_socket_flushed"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamWriteSocketBlocked { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamWriteSocketBlocked { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamWriteSocketBlocked"); + fmt.field("provided_len", &self.provided_len); + fmt.field("processing_duration", &self.processing_duration); + fmt.finish() + } + } + impl Event for StreamWriteSocketBlocked { + const NAME: &'static str = "stream:write_socket_blocked"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamWriteSocketErrored { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, + #[doc = " The amount of time it took to process the write request"] + pub processing_duration: core::time::Duration, + #[doc = " The system `errno` from the returned error"] + pub errno: Option, } #[cfg(any(test, feature = "testing"))] - impl crate::event::snapshot::Fmt for ApplicationWrite { + impl crate::event::snapshot::Fmt for StreamWriteSocketErrored { fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { - let mut fmt = fmt.debug_struct("ApplicationWrite"); - fmt.field("total_len", &self.total_len); - fmt.field("write_len", &self.write_len); + let mut fmt = fmt.debug_struct("StreamWriteSocketErrored"); + fmt.field("provided_len", &self.provided_len); + fmt.field("processing_duration", &self.processing_duration); + fmt.field("errno", &self.errno); fmt.finish() } } - impl Event for ApplicationWrite { - const NAME: &'static str = "application:write"; + impl Event for StreamWriteSocketErrored { + const NAME: &'static str = "stream:write_socket_errored"; } #[derive(Clone, Debug)] #[non_exhaustive] - pub struct ApplicationRead { + pub struct StreamReadFlushed { #[doc = " The number of bytes that the application tried to read"] pub capacity: usize, #[doc = " The amount that was read"] - pub read_len: usize, + pub committed_len: usize, + #[doc = " The amount of time it took to process the read request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and decryption overhead"] + pub processing_duration: core::time::Duration, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamReadFlushed { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamReadFlushed"); + fmt.field("capacity", &self.capacity); + fmt.field("committed_len", &self.committed_len); + fmt.field("processing_duration", &self.processing_duration); + fmt.finish() + } + } + impl Event for StreamReadFlushed { + const NAME: &'static str = "stream:read_flushed"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamReadBlocked { + #[doc = " The number of bytes that the application tried to read"] + pub capacity: usize, + #[doc = " The amount of time it took to process the read request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and decryption overhead"] + pub processing_duration: core::time::Duration, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamReadBlocked { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamReadBlocked"); + fmt.field("capacity", &self.capacity); + fmt.field("processing_duration", &self.processing_duration); + fmt.finish() + } + } + impl Event for StreamReadBlocked { + const NAME: &'static str = "stream:read_blocked"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamReadErrored { + #[doc = " The number of bytes that the application tried to read"] + pub capacity: usize, + #[doc = " The amount of time it took to process the read request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and decryption overhead"] + pub processing_duration: core::time::Duration, + #[doc = " The system `errno` from the returned error"] + pub errno: Option, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamReadErrored { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamReadErrored"); + fmt.field("capacity", &self.capacity); + fmt.field("processing_duration", &self.processing_duration); + fmt.field("errno", &self.errno); + fmt.finish() + } + } + impl Event for StreamReadErrored { + const NAME: &'static str = "stream:read_errored"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamReadShutdown { + #[doc = " If the stream required a background task to drive the stream shutdown"] + pub background: bool, } #[cfg(any(test, feature = "testing"))] - impl crate::event::snapshot::Fmt for ApplicationRead { + impl crate::event::snapshot::Fmt for StreamReadShutdown { fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { - let mut fmt = fmt.debug_struct("ApplicationRead"); + let mut fmt = fmt.debug_struct("StreamReadShutdown"); + fmt.field("background", &self.background); + fmt.finish() + } + } + impl Event for StreamReadShutdown { + const NAME: &'static str = "stream:read_shutdown"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamReadSocketFlushed { + pub capacity: usize, + pub committed_len: usize, + #[doc = " The amount of time it took to process the read request"] + pub processing_duration: core::time::Duration, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamReadSocketFlushed { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamReadSocketFlushed"); + fmt.field("capacity", &self.capacity); + fmt.field("committed_len", &self.committed_len); + fmt.field("processing_duration", &self.processing_duration); + fmt.finish() + } + } + impl Event for StreamReadSocketFlushed { + const NAME: &'static str = "stream:read_socket_flushed"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamReadSocketBlocked { + pub capacity: usize, + #[doc = " The amount of time it took to process the read request"] + pub processing_duration: core::time::Duration, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamReadSocketBlocked { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamReadSocketBlocked"); + fmt.field("capacity", &self.capacity); + fmt.field("processing_duration", &self.processing_duration); + fmt.finish() + } + } + impl Event for StreamReadSocketBlocked { + const NAME: &'static str = "stream:read_socket_blocked"; + } + #[derive(Clone, Debug)] + #[non_exhaustive] + pub struct StreamReadSocketErrored { + pub capacity: usize, + #[doc = " The amount of time it took to process the read request"] + pub processing_duration: core::time::Duration, + #[doc = " The system `errno` from the returned error"] + pub errno: Option, + } + #[cfg(any(test, feature = "testing"))] + impl crate::event::snapshot::Fmt for StreamReadSocketErrored { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + let mut fmt = fmt.debug_struct("StreamReadSocketErrored"); fmt.field("capacity", &self.capacity); - fmt.field("read_len", &self.read_len); + fmt.field("processing_duration", &self.processing_duration); + fmt.field("errno", &self.errno); fmt.finish() } } - impl Event for ApplicationRead { - const NAME: &'static str = "application:read"; + impl Event for StreamReadSocketErrored { + const NAME: &'static str = "stream:read_socket_errored"; } #[derive(Clone, Debug)] #[non_exhaustive] @@ -1542,116 +1821,295 @@ pub mod tracing { tracing :: event ! (target : "acceptor_stream_dequeued" , parent : parent , tracing :: Level :: DEBUG , remote_address = tracing :: field :: debug (remote_address) , credential_id = tracing :: field :: debug (credential_id) , stream_id = tracing :: field :: debug (stream_id) , sojourn_time = tracing :: field :: debug (sojourn_time)); } #[inline] - fn on_application_write( + fn on_stream_write_flushed( &self, context: &Self::ConnectionContext, _meta: &api::ConnectionMeta, - event: &api::ApplicationWrite, + event: &api::StreamWriteFlushed, ) { let id = context.id(); - let api::ApplicationWrite { - total_len, - write_len, + let api::StreamWriteFlushed { + provided_len, + committed_len, + is_fin, + processing_duration, } = event; - tracing :: event ! (target : "application_write" , parent : id , tracing :: Level :: DEBUG , total_len = tracing :: field :: debug (total_len) , write_len = tracing :: field :: debug (write_len)); + tracing :: event ! (target : "stream_write_flushed" , parent : id , tracing :: Level :: DEBUG , provided_len = tracing :: field :: debug (provided_len) , committed_len = tracing :: field :: debug (committed_len) , is_fin = tracing :: field :: debug (is_fin) , processing_duration = tracing :: field :: debug (processing_duration)); } #[inline] - fn on_application_read( + fn on_stream_write_blocked( &self, context: &Self::ConnectionContext, _meta: &api::ConnectionMeta, - event: &api::ApplicationRead, + event: &api::StreamWriteBlocked, ) { let id = context.id(); - let api::ApplicationRead { capacity, read_len } = event; - tracing :: event ! (target : "application_read" , parent : id , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity) , read_len = tracing :: field :: debug (read_len)); + let api::StreamWriteBlocked { + provided_len, + is_fin, + processing_duration, + } = event; + tracing :: event ! (target : "stream_write_blocked" , parent : id , tracing :: Level :: DEBUG , provided_len = tracing :: field :: debug (provided_len) , is_fin = tracing :: field :: debug (is_fin) , processing_duration = tracing :: field :: debug (processing_duration)); } #[inline] - fn on_endpoint_initialized( + fn on_stream_write_errored( &self, - meta: &api::EndpointMeta, - event: &api::EndpointInitialized, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamWriteErrored, ) { - let parent = self.parent(meta); - let api::EndpointInitialized { - acceptor_addr, - handshake_addr, - tcp, - udp, + let id = context.id(); + let api::StreamWriteErrored { + provided_len, + is_fin, + processing_duration, + errno, } = event; - tracing :: event ! (target : "endpoint_initialized" , parent : parent , tracing :: Level :: DEBUG , acceptor_addr = tracing :: field :: debug (acceptor_addr) , handshake_addr = tracing :: field :: debug (handshake_addr) , tcp = tracing :: field :: debug (tcp) , udp = tracing :: field :: debug (udp)); + tracing :: event ! (target : "stream_write_errored" , parent : id , tracing :: Level :: DEBUG , provided_len = tracing :: field :: debug (provided_len) , is_fin = tracing :: field :: debug (is_fin) , processing_duration = tracing :: field :: debug (processing_duration) , errno = tracing :: field :: debug (errno)); } #[inline] - fn on_path_secret_map_initialized( + fn on_stream_write_shutdown( &self, - meta: &api::EndpointMeta, - event: &api::PathSecretMapInitialized, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamWriteShutdown, ) { - let parent = self.parent(meta); - let api::PathSecretMapInitialized { capacity } = event; - tracing :: event ! (target : "path_secret_map_initialized" , parent : parent , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity)); + let id = context.id(); + let api::StreamWriteShutdown { + buffer_len, + background, + } = event; + tracing :: event ! (target : "stream_write_shutdown" , parent : id , tracing :: Level :: DEBUG , buffer_len = tracing :: field :: debug (buffer_len) , background = tracing :: field :: debug (background)); } #[inline] - fn on_path_secret_map_uninitialized( + fn on_stream_write_socket_flushed( &self, - meta: &api::EndpointMeta, - event: &api::PathSecretMapUninitialized, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketFlushed, ) { - let parent = self.parent(meta); - let api::PathSecretMapUninitialized { - capacity, - entries, - lifetime, + let id = context.id(); + let api::StreamWriteSocketFlushed { + provided_len, + committed_len, + processing_duration, } = event; - tracing :: event ! (target : "path_secret_map_uninitialized" , parent : parent , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity) , entries = tracing :: field :: debug (entries) , lifetime = tracing :: field :: debug (lifetime)); + tracing :: event ! (target : "stream_write_socket_flushed" , parent : id , tracing :: Level :: DEBUG , provided_len = tracing :: field :: debug (provided_len) , committed_len = tracing :: field :: debug (committed_len) , processing_duration = tracing :: field :: debug (processing_duration)); } #[inline] - fn on_path_secret_map_background_handshake_requested( + fn on_stream_write_socket_blocked( &self, - meta: &api::EndpointMeta, - event: &api::PathSecretMapBackgroundHandshakeRequested, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketBlocked, ) { - let parent = self.parent(meta); - let api::PathSecretMapBackgroundHandshakeRequested { peer_address } = event; - tracing :: event ! (target : "path_secret_map_background_handshake_requested" , parent : parent , tracing :: Level :: DEBUG , peer_address = tracing :: field :: debug (peer_address)); + let id = context.id(); + let api::StreamWriteSocketBlocked { + provided_len, + processing_duration, + } = event; + tracing :: event ! (target : "stream_write_socket_blocked" , parent : id , tracing :: Level :: DEBUG , provided_len = tracing :: field :: debug (provided_len) , processing_duration = tracing :: field :: debug (processing_duration)); } #[inline] - fn on_path_secret_map_entry_inserted( + fn on_stream_write_socket_errored( &self, - meta: &api::EndpointMeta, - event: &api::PathSecretMapEntryInserted, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketErrored, ) { - let parent = self.parent(meta); - let api::PathSecretMapEntryInserted { - peer_address, - credential_id, + let id = context.id(); + let api::StreamWriteSocketErrored { + provided_len, + processing_duration, + errno, } = event; - tracing :: event ! (target : "path_secret_map_entry_inserted" , parent : parent , tracing :: Level :: DEBUG , peer_address = tracing :: field :: debug (peer_address) , credential_id = tracing :: field :: debug (credential_id)); + tracing :: event ! (target : "stream_write_socket_errored" , parent : id , tracing :: Level :: DEBUG , provided_len = tracing :: field :: debug (provided_len) , processing_duration = tracing :: field :: debug (processing_duration) , errno = tracing :: field :: debug (errno)); } #[inline] - fn on_path_secret_map_entry_ready( + fn on_stream_read_flushed( &self, - meta: &api::EndpointMeta, - event: &api::PathSecretMapEntryReady, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamReadFlushed, ) { - let parent = self.parent(meta); - let api::PathSecretMapEntryReady { - peer_address, - credential_id, + let id = context.id(); + let api::StreamReadFlushed { + capacity, + committed_len, + processing_duration, } = event; - tracing :: event ! (target : "path_secret_map_entry_ready" , parent : parent , tracing :: Level :: DEBUG , peer_address = tracing :: field :: debug (peer_address) , credential_id = tracing :: field :: debug (credential_id)); + tracing :: event ! (target : "stream_read_flushed" , parent : id , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity) , committed_len = tracing :: field :: debug (committed_len) , processing_duration = tracing :: field :: debug (processing_duration)); } #[inline] - fn on_path_secret_map_entry_replaced( + fn on_stream_read_blocked( &self, - meta: &api::EndpointMeta, - event: &api::PathSecretMapEntryReplaced, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamReadBlocked, ) { - let parent = self.parent(meta); - let api::PathSecretMapEntryReplaced { - peer_address, - new_credential_id, - previous_credential_id, + let id = context.id(); + let api::StreamReadBlocked { + capacity, + processing_duration, + } = event; + tracing :: event ! (target : "stream_read_blocked" , parent : id , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity) , processing_duration = tracing :: field :: debug (processing_duration)); + } + #[inline] + fn on_stream_read_errored( + &self, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamReadErrored, + ) { + let id = context.id(); + let api::StreamReadErrored { + capacity, + processing_duration, + errno, + } = event; + tracing :: event ! (target : "stream_read_errored" , parent : id , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity) , processing_duration = tracing :: field :: debug (processing_duration) , errno = tracing :: field :: debug (errno)); + } + #[inline] + fn on_stream_read_shutdown( + &self, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamReadShutdown, + ) { + let id = context.id(); + let api::StreamReadShutdown { background } = event; + tracing :: event ! (target : "stream_read_shutdown" , parent : id , tracing :: Level :: DEBUG , background = tracing :: field :: debug (background)); + } + #[inline] + fn on_stream_read_socket_flushed( + &self, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamReadSocketFlushed, + ) { + let id = context.id(); + let api::StreamReadSocketFlushed { + capacity, + committed_len, + processing_duration, + } = event; + tracing :: event ! (target : "stream_read_socket_flushed" , parent : id , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity) , committed_len = tracing :: field :: debug (committed_len) , processing_duration = tracing :: field :: debug (processing_duration)); + } + #[inline] + fn on_stream_read_socket_blocked( + &self, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamReadSocketBlocked, + ) { + let id = context.id(); + let api::StreamReadSocketBlocked { + capacity, + processing_duration, + } = event; + tracing :: event ! (target : "stream_read_socket_blocked" , parent : id , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity) , processing_duration = tracing :: field :: debug (processing_duration)); + } + #[inline] + fn on_stream_read_socket_errored( + &self, + context: &Self::ConnectionContext, + _meta: &api::ConnectionMeta, + event: &api::StreamReadSocketErrored, + ) { + let id = context.id(); + let api::StreamReadSocketErrored { + capacity, + processing_duration, + errno, + } = event; + tracing :: event ! (target : "stream_read_socket_errored" , parent : id , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity) , processing_duration = tracing :: field :: debug (processing_duration) , errno = tracing :: field :: debug (errno)); + } + #[inline] + fn on_endpoint_initialized( + &self, + meta: &api::EndpointMeta, + event: &api::EndpointInitialized, + ) { + let parent = self.parent(meta); + let api::EndpointInitialized { + acceptor_addr, + handshake_addr, + tcp, + udp, + } = event; + tracing :: event ! (target : "endpoint_initialized" , parent : parent , tracing :: Level :: DEBUG , acceptor_addr = tracing :: field :: debug (acceptor_addr) , handshake_addr = tracing :: field :: debug (handshake_addr) , tcp = tracing :: field :: debug (tcp) , udp = tracing :: field :: debug (udp)); + } + #[inline] + fn on_path_secret_map_initialized( + &self, + meta: &api::EndpointMeta, + event: &api::PathSecretMapInitialized, + ) { + let parent = self.parent(meta); + let api::PathSecretMapInitialized { capacity } = event; + tracing :: event ! (target : "path_secret_map_initialized" , parent : parent , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity)); + } + #[inline] + fn on_path_secret_map_uninitialized( + &self, + meta: &api::EndpointMeta, + event: &api::PathSecretMapUninitialized, + ) { + let parent = self.parent(meta); + let api::PathSecretMapUninitialized { + capacity, + entries, + lifetime, + } = event; + tracing :: event ! (target : "path_secret_map_uninitialized" , parent : parent , tracing :: Level :: DEBUG , capacity = tracing :: field :: debug (capacity) , entries = tracing :: field :: debug (entries) , lifetime = tracing :: field :: debug (lifetime)); + } + #[inline] + fn on_path_secret_map_background_handshake_requested( + &self, + meta: &api::EndpointMeta, + event: &api::PathSecretMapBackgroundHandshakeRequested, + ) { + let parent = self.parent(meta); + let api::PathSecretMapBackgroundHandshakeRequested { peer_address } = event; + tracing :: event ! (target : "path_secret_map_background_handshake_requested" , parent : parent , tracing :: Level :: DEBUG , peer_address = tracing :: field :: debug (peer_address)); + } + #[inline] + fn on_path_secret_map_entry_inserted( + &self, + meta: &api::EndpointMeta, + event: &api::PathSecretMapEntryInserted, + ) { + let parent = self.parent(meta); + let api::PathSecretMapEntryInserted { + peer_address, + credential_id, + } = event; + tracing :: event ! (target : "path_secret_map_entry_inserted" , parent : parent , tracing :: Level :: DEBUG , peer_address = tracing :: field :: debug (peer_address) , credential_id = tracing :: field :: debug (credential_id)); + } + #[inline] + fn on_path_secret_map_entry_ready( + &self, + meta: &api::EndpointMeta, + event: &api::PathSecretMapEntryReady, + ) { + let parent = self.parent(meta); + let api::PathSecretMapEntryReady { + peer_address, + credential_id, + } = event; + tracing :: event ! (target : "path_secret_map_entry_ready" , parent : parent , tracing :: Level :: DEBUG , peer_address = tracing :: field :: debug (peer_address) , credential_id = tracing :: field :: debug (credential_id)); + } + #[inline] + fn on_path_secret_map_entry_replaced( + &self, + meta: &api::EndpointMeta, + event: &api::PathSecretMapEntryReplaced, + ) { + let parent = self.parent(meta); + let api::PathSecretMapEntryReplaced { + peer_address, + new_credential_id, + previous_credential_id, } = event; tracing :: event ! (target : "path_secret_map_entry_replaced" , parent : parent , tracing :: Level :: DEBUG , peer_address = tracing :: field :: debug (peer_address) , new_credential_id = tracing :: field :: debug (new_credential_id) , previous_credential_id = tracing :: field :: debug (previous_credential_id)); } @@ -2497,39 +2955,329 @@ pub mod builder { } } #[derive(Clone, Debug)] - pub struct ApplicationWrite { + pub struct StreamWriteFlushed { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, + #[doc = " The amount that was written"] + pub committed_len: usize, + pub is_fin: bool, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + } + impl IntoEvent for StreamWriteFlushed { + #[inline] + fn into_event(self) -> api::StreamWriteFlushed { + let StreamWriteFlushed { + provided_len, + committed_len, + is_fin, + processing_duration, + } = self; + api::StreamWriteFlushed { + provided_len: provided_len.into_event(), + committed_len: committed_len.into_event(), + is_fin: is_fin.into_event(), + processing_duration: processing_duration.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamWriteBlocked { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, + pub is_fin: bool, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + } + impl IntoEvent for StreamWriteBlocked { + #[inline] + fn into_event(self) -> api::StreamWriteBlocked { + let StreamWriteBlocked { + provided_len, + is_fin, + processing_duration, + } = self; + api::StreamWriteBlocked { + provided_len: provided_len.into_event(), + is_fin: is_fin.into_event(), + processing_duration: processing_duration.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamWriteErrored { #[doc = " The number of bytes that the application tried to write"] - pub total_len: usize, + pub provided_len: usize, + pub is_fin: bool, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + #[doc = " The system `errno` from the returned error"] + pub errno: Option, + } + impl IntoEvent for StreamWriteErrored { + #[inline] + fn into_event(self) -> api::StreamWriteErrored { + let StreamWriteErrored { + provided_len, + is_fin, + processing_duration, + errno, + } = self; + api::StreamWriteErrored { + provided_len: provided_len.into_event(), + is_fin: is_fin.into_event(), + processing_duration: processing_duration.into_event(), + errno: errno.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamWriteShutdown { + #[doc = " The number of bytes in the send buffer at the time of shutdown"] + pub buffer_len: usize, + #[doc = " If the stream required a background task to drive the stream shutdown"] + pub background: bool, + } + impl IntoEvent for StreamWriteShutdown { + #[inline] + fn into_event(self) -> api::StreamWriteShutdown { + let StreamWriteShutdown { + buffer_len, + background, + } = self; + api::StreamWriteShutdown { + buffer_len: buffer_len.into_event(), + background: background.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamWriteSocketFlushed { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, #[doc = " The amount that was written"] - pub write_len: usize, + pub committed_len: usize, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + } + impl IntoEvent for StreamWriteSocketFlushed { + #[inline] + fn into_event(self) -> api::StreamWriteSocketFlushed { + let StreamWriteSocketFlushed { + provided_len, + committed_len, + processing_duration, + } = self; + api::StreamWriteSocketFlushed { + provided_len: provided_len.into_event(), + committed_len: committed_len.into_event(), + processing_duration: processing_duration.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamWriteSocketBlocked { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, + #[doc = " The amount of time it took to process the write request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and encryption overhead"] + pub processing_duration: core::time::Duration, + } + impl IntoEvent for StreamWriteSocketBlocked { + #[inline] + fn into_event(self) -> api::StreamWriteSocketBlocked { + let StreamWriteSocketBlocked { + provided_len, + processing_duration, + } = self; + api::StreamWriteSocketBlocked { + provided_len: provided_len.into_event(), + processing_duration: processing_duration.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamWriteSocketErrored { + #[doc = " The number of bytes that the application tried to write"] + pub provided_len: usize, + #[doc = " The amount of time it took to process the write request"] + pub processing_duration: core::time::Duration, + #[doc = " The system `errno` from the returned error"] + pub errno: Option, } - impl IntoEvent for ApplicationWrite { + impl IntoEvent for StreamWriteSocketErrored { #[inline] - fn into_event(self) -> api::ApplicationWrite { - let ApplicationWrite { - total_len, - write_len, + fn into_event(self) -> api::StreamWriteSocketErrored { + let StreamWriteSocketErrored { + provided_len, + processing_duration, + errno, } = self; - api::ApplicationWrite { - total_len: total_len.into_event(), - write_len: write_len.into_event(), + api::StreamWriteSocketErrored { + provided_len: provided_len.into_event(), + processing_duration: processing_duration.into_event(), + errno: errno.into_event(), } } } #[derive(Clone, Debug)] - pub struct ApplicationRead { + pub struct StreamReadFlushed { #[doc = " The number of bytes that the application tried to read"] pub capacity: usize, #[doc = " The amount that was read"] - pub read_len: usize, + pub committed_len: usize, + #[doc = " The amount of time it took to process the read request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and decryption overhead"] + pub processing_duration: core::time::Duration, + } + impl IntoEvent for StreamReadFlushed { + #[inline] + fn into_event(self) -> api::StreamReadFlushed { + let StreamReadFlushed { + capacity, + committed_len, + processing_duration, + } = self; + api::StreamReadFlushed { + capacity: capacity.into_event(), + committed_len: committed_len.into_event(), + processing_duration: processing_duration.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamReadBlocked { + #[doc = " The number of bytes that the application tried to read"] + pub capacity: usize, + #[doc = " The amount of time it took to process the read request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and decryption overhead"] + pub processing_duration: core::time::Duration, + } + impl IntoEvent for StreamReadBlocked { + #[inline] + fn into_event(self) -> api::StreamReadBlocked { + let StreamReadBlocked { + capacity, + processing_duration, + } = self; + api::StreamReadBlocked { + capacity: capacity.into_event(), + processing_duration: processing_duration.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamReadErrored { + #[doc = " The number of bytes that the application tried to read"] + pub capacity: usize, + #[doc = " The amount of time it took to process the read request"] + #[doc = ""] + #[doc = " Note that this includes both any syscall and decryption overhead"] + pub processing_duration: core::time::Duration, + #[doc = " The system `errno` from the returned error"] + pub errno: Option, + } + impl IntoEvent for StreamReadErrored { + #[inline] + fn into_event(self) -> api::StreamReadErrored { + let StreamReadErrored { + capacity, + processing_duration, + errno, + } = self; + api::StreamReadErrored { + capacity: capacity.into_event(), + processing_duration: processing_duration.into_event(), + errno: errno.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamReadShutdown { + #[doc = " If the stream required a background task to drive the stream shutdown"] + pub background: bool, + } + impl IntoEvent for StreamReadShutdown { + #[inline] + fn into_event(self) -> api::StreamReadShutdown { + let StreamReadShutdown { background } = self; + api::StreamReadShutdown { + background: background.into_event(), + } + } } - impl IntoEvent for ApplicationRead { + #[derive(Clone, Debug)] + pub struct StreamReadSocketFlushed { + pub capacity: usize, + pub committed_len: usize, + #[doc = " The amount of time it took to process the read request"] + pub processing_duration: core::time::Duration, + } + impl IntoEvent for StreamReadSocketFlushed { #[inline] - fn into_event(self) -> api::ApplicationRead { - let ApplicationRead { capacity, read_len } = self; - api::ApplicationRead { + fn into_event(self) -> api::StreamReadSocketFlushed { + let StreamReadSocketFlushed { + capacity, + committed_len, + processing_duration, + } = self; + api::StreamReadSocketFlushed { capacity: capacity.into_event(), - read_len: read_len.into_event(), + committed_len: committed_len.into_event(), + processing_duration: processing_duration.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamReadSocketBlocked { + pub capacity: usize, + #[doc = " The amount of time it took to process the read request"] + pub processing_duration: core::time::Duration, + } + impl IntoEvent for StreamReadSocketBlocked { + #[inline] + fn into_event(self) -> api::StreamReadSocketBlocked { + let StreamReadSocketBlocked { + capacity, + processing_duration, + } = self; + api::StreamReadSocketBlocked { + capacity: capacity.into_event(), + processing_duration: processing_duration.into_event(), + } + } + } + #[derive(Clone, Debug)] + pub struct StreamReadSocketErrored { + pub capacity: usize, + #[doc = " The amount of time it took to process the read request"] + pub processing_duration: core::time::Duration, + #[doc = " The system `errno` from the returned error"] + pub errno: Option, + } + impl IntoEvent for StreamReadSocketErrored { + #[inline] + fn into_event(self) -> api::StreamReadSocketErrored { + let StreamReadSocketErrored { + capacity, + processing_duration, + errno, + } = self; + api::StreamReadSocketErrored { + capacity: capacity.into_event(), + processing_duration: processing_duration.into_event(), + errno: errno.into_event(), } } } @@ -3350,45 +4098,189 @@ mod traits { let _ = meta; let _ = event; } - #[doc = "Called when the `AcceptorStreamPruned` event is triggered"] + #[doc = "Called when the `AcceptorStreamPruned` event is triggered"] + #[inline] + fn on_acceptor_stream_pruned( + &self, + meta: &api::EndpointMeta, + event: &api::AcceptorStreamPruned, + ) { + let _ = meta; + let _ = event; + } + #[doc = "Called when the `AcceptorStreamDequeued` event is triggered"] + #[inline] + fn on_acceptor_stream_dequeued( + &self, + meta: &api::EndpointMeta, + event: &api::AcceptorStreamDequeued, + ) { + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamWriteFlushed` event is triggered"] + #[inline] + fn on_stream_write_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteFlushed, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamWriteBlocked` event is triggered"] + #[inline] + fn on_stream_write_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteBlocked, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamWriteErrored` event is triggered"] + #[inline] + fn on_stream_write_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteErrored, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamWriteShutdown` event is triggered"] + #[inline] + fn on_stream_write_shutdown( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteShutdown, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamWriteSocketFlushed` event is triggered"] + #[inline] + fn on_stream_write_socket_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketFlushed, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamWriteSocketBlocked` event is triggered"] + #[inline] + fn on_stream_write_socket_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketBlocked, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamWriteSocketErrored` event is triggered"] + #[inline] + fn on_stream_write_socket_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketErrored, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamReadFlushed` event is triggered"] + #[inline] + fn on_stream_read_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadFlushed, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamReadBlocked` event is triggered"] + #[inline] + fn on_stream_read_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadBlocked, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamReadErrored` event is triggered"] + #[inline] + fn on_stream_read_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadErrored, + ) { + let _ = context; + let _ = meta; + let _ = event; + } + #[doc = "Called when the `StreamReadShutdown` event is triggered"] #[inline] - fn on_acceptor_stream_pruned( + fn on_stream_read_shutdown( &self, - meta: &api::EndpointMeta, - event: &api::AcceptorStreamPruned, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadShutdown, ) { + let _ = context; let _ = meta; let _ = event; } - #[doc = "Called when the `AcceptorStreamDequeued` event is triggered"] + #[doc = "Called when the `StreamReadSocketFlushed` event is triggered"] #[inline] - fn on_acceptor_stream_dequeued( + fn on_stream_read_socket_flushed( &self, - meta: &api::EndpointMeta, - event: &api::AcceptorStreamDequeued, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadSocketFlushed, ) { + let _ = context; let _ = meta; let _ = event; } - #[doc = "Called when the `ApplicationWrite` event is triggered"] + #[doc = "Called when the `StreamReadSocketBlocked` event is triggered"] #[inline] - fn on_application_write( + fn on_stream_read_socket_blocked( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationWrite, + event: &api::StreamReadSocketBlocked, ) { let _ = context; let _ = meta; let _ = event; } - #[doc = "Called when the `ApplicationRead` event is triggered"] + #[doc = "Called when the `StreamReadSocketErrored` event is triggered"] #[inline] - fn on_application_read( + fn on_stream_read_socket_errored( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationRead, + event: &api::StreamReadSocketErrored, ) { let _ = context; let _ = meta; @@ -3854,22 +4746,136 @@ mod traits { self.as_ref().on_acceptor_stream_dequeued(meta, event); } #[inline] - fn on_application_write( + fn on_stream_write_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteFlushed, + ) { + self.as_ref().on_stream_write_flushed(context, meta, event); + } + #[inline] + fn on_stream_write_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteBlocked, + ) { + self.as_ref().on_stream_write_blocked(context, meta, event); + } + #[inline] + fn on_stream_write_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteErrored, + ) { + self.as_ref().on_stream_write_errored(context, meta, event); + } + #[inline] + fn on_stream_write_shutdown( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteShutdown, + ) { + self.as_ref().on_stream_write_shutdown(context, meta, event); + } + #[inline] + fn on_stream_write_socket_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketFlushed, + ) { + self.as_ref() + .on_stream_write_socket_flushed(context, meta, event); + } + #[inline] + fn on_stream_write_socket_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketBlocked, + ) { + self.as_ref() + .on_stream_write_socket_blocked(context, meta, event); + } + #[inline] + fn on_stream_write_socket_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketErrored, + ) { + self.as_ref() + .on_stream_write_socket_errored(context, meta, event); + } + #[inline] + fn on_stream_read_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadFlushed, + ) { + self.as_ref().on_stream_read_flushed(context, meta, event); + } + #[inline] + fn on_stream_read_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadBlocked, + ) { + self.as_ref().on_stream_read_blocked(context, meta, event); + } + #[inline] + fn on_stream_read_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadErrored, + ) { + self.as_ref().on_stream_read_errored(context, meta, event); + } + #[inline] + fn on_stream_read_shutdown( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadShutdown, + ) { + self.as_ref().on_stream_read_shutdown(context, meta, event); + } + #[inline] + fn on_stream_read_socket_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadSocketFlushed, + ) { + self.as_ref() + .on_stream_read_socket_flushed(context, meta, event); + } + #[inline] + fn on_stream_read_socket_blocked( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationWrite, + event: &api::StreamReadSocketBlocked, ) { - self.as_ref().on_application_write(context, meta, event); + self.as_ref() + .on_stream_read_socket_blocked(context, meta, event); } #[inline] - fn on_application_read( + fn on_stream_read_socket_errored( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationRead, + event: &api::StreamReadSocketErrored, ) { - self.as_ref().on_application_read(context, meta, event); + self.as_ref() + .on_stream_read_socket_errored(context, meta, event); } #[inline] fn on_endpoint_initialized( @@ -4298,24 +5304,144 @@ mod traits { (self.1).on_acceptor_stream_dequeued(meta, event); } #[inline] - fn on_application_write( + fn on_stream_write_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteFlushed, + ) { + (self.0).on_stream_write_flushed(&context.0, meta, event); + (self.1).on_stream_write_flushed(&context.1, meta, event); + } + #[inline] + fn on_stream_write_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteBlocked, + ) { + (self.0).on_stream_write_blocked(&context.0, meta, event); + (self.1).on_stream_write_blocked(&context.1, meta, event); + } + #[inline] + fn on_stream_write_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteErrored, + ) { + (self.0).on_stream_write_errored(&context.0, meta, event); + (self.1).on_stream_write_errored(&context.1, meta, event); + } + #[inline] + fn on_stream_write_shutdown( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteShutdown, + ) { + (self.0).on_stream_write_shutdown(&context.0, meta, event); + (self.1).on_stream_write_shutdown(&context.1, meta, event); + } + #[inline] + fn on_stream_write_socket_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketFlushed, + ) { + (self.0).on_stream_write_socket_flushed(&context.0, meta, event); + (self.1).on_stream_write_socket_flushed(&context.1, meta, event); + } + #[inline] + fn on_stream_write_socket_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketBlocked, + ) { + (self.0).on_stream_write_socket_blocked(&context.0, meta, event); + (self.1).on_stream_write_socket_blocked(&context.1, meta, event); + } + #[inline] + fn on_stream_write_socket_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketErrored, + ) { + (self.0).on_stream_write_socket_errored(&context.0, meta, event); + (self.1).on_stream_write_socket_errored(&context.1, meta, event); + } + #[inline] + fn on_stream_read_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadFlushed, + ) { + (self.0).on_stream_read_flushed(&context.0, meta, event); + (self.1).on_stream_read_flushed(&context.1, meta, event); + } + #[inline] + fn on_stream_read_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadBlocked, + ) { + (self.0).on_stream_read_blocked(&context.0, meta, event); + (self.1).on_stream_read_blocked(&context.1, meta, event); + } + #[inline] + fn on_stream_read_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadErrored, + ) { + (self.0).on_stream_read_errored(&context.0, meta, event); + (self.1).on_stream_read_errored(&context.1, meta, event); + } + #[inline] + fn on_stream_read_shutdown( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadShutdown, + ) { + (self.0).on_stream_read_shutdown(&context.0, meta, event); + (self.1).on_stream_read_shutdown(&context.1, meta, event); + } + #[inline] + fn on_stream_read_socket_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadSocketFlushed, + ) { + (self.0).on_stream_read_socket_flushed(&context.0, meta, event); + (self.1).on_stream_read_socket_flushed(&context.1, meta, event); + } + #[inline] + fn on_stream_read_socket_blocked( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationWrite, + event: &api::StreamReadSocketBlocked, ) { - (self.0).on_application_write(&context.0, meta, event); - (self.1).on_application_write(&context.1, meta, event); + (self.0).on_stream_read_socket_blocked(&context.0, meta, event); + (self.1).on_stream_read_socket_blocked(&context.1, meta, event); } #[inline] - fn on_application_read( + fn on_stream_read_socket_errored( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationRead, + event: &api::StreamReadSocketErrored, ) { - (self.0).on_application_read(&context.0, meta, event); - (self.1).on_application_read(&context.1, meta, event); + (self.0).on_stream_read_socket_errored(&context.0, meta, event); + (self.1).on_stream_read_socket_errored(&context.1, meta, event); } #[inline] fn on_endpoint_initialized( @@ -5090,10 +6216,34 @@ mod traits { } } pub trait ConnectionPublisher { - #[doc = "Publishes a `ApplicationWrite` event to the publisher's subscriber"] - fn on_application_write(&self, event: builder::ApplicationWrite); - #[doc = "Publishes a `ApplicationRead` event to the publisher's subscriber"] - fn on_application_read(&self, event: builder::ApplicationRead); + #[doc = "Publishes a `StreamWriteFlushed` event to the publisher's subscriber"] + fn on_stream_write_flushed(&self, event: builder::StreamWriteFlushed); + #[doc = "Publishes a `StreamWriteBlocked` event to the publisher's subscriber"] + fn on_stream_write_blocked(&self, event: builder::StreamWriteBlocked); + #[doc = "Publishes a `StreamWriteErrored` event to the publisher's subscriber"] + fn on_stream_write_errored(&self, event: builder::StreamWriteErrored); + #[doc = "Publishes a `StreamWriteShutdown` event to the publisher's subscriber"] + fn on_stream_write_shutdown(&self, event: builder::StreamWriteShutdown); + #[doc = "Publishes a `StreamWriteSocketFlushed` event to the publisher's subscriber"] + fn on_stream_write_socket_flushed(&self, event: builder::StreamWriteSocketFlushed); + #[doc = "Publishes a `StreamWriteSocketBlocked` event to the publisher's subscriber"] + fn on_stream_write_socket_blocked(&self, event: builder::StreamWriteSocketBlocked); + #[doc = "Publishes a `StreamWriteSocketErrored` event to the publisher's subscriber"] + fn on_stream_write_socket_errored(&self, event: builder::StreamWriteSocketErrored); + #[doc = "Publishes a `StreamReadFlushed` event to the publisher's subscriber"] + fn on_stream_read_flushed(&self, event: builder::StreamReadFlushed); + #[doc = "Publishes a `StreamReadBlocked` event to the publisher's subscriber"] + fn on_stream_read_blocked(&self, event: builder::StreamReadBlocked); + #[doc = "Publishes a `StreamReadErrored` event to the publisher's subscriber"] + fn on_stream_read_errored(&self, event: builder::StreamReadErrored); + #[doc = "Publishes a `StreamReadShutdown` event to the publisher's subscriber"] + fn on_stream_read_shutdown(&self, event: builder::StreamReadShutdown); + #[doc = "Publishes a `StreamReadSocketFlushed` event to the publisher's subscriber"] + fn on_stream_read_socket_flushed(&self, event: builder::StreamReadSocketFlushed); + #[doc = "Publishes a `StreamReadSocketBlocked` event to the publisher's subscriber"] + fn on_stream_read_socket_blocked(&self, event: builder::StreamReadSocketBlocked); + #[doc = "Publishes a `StreamReadSocketErrored` event to the publisher's subscriber"] + fn on_stream_read_socket_errored(&self, event: builder::StreamReadSocketErrored); #[doc = r" Returns the QUIC version negotiated for the current connection, if any"] fn quic_version(&self) -> u32; #[doc = r" Returns the [`Subject`] for the current publisher"] @@ -5112,38 +6262,146 @@ mod traits { .field("quic_version", &self.quic_version) .finish() } - } - impl<'a, Sub: Subscriber> ConnectionPublisherSubscriber<'a, Sub> { + } + impl<'a, Sub: Subscriber> ConnectionPublisherSubscriber<'a, Sub> { + #[inline] + pub fn new( + meta: builder::ConnectionMeta, + quic_version: u32, + subscriber: &'a Sub, + context: &'a Sub::ConnectionContext, + ) -> Self { + Self { + meta: meta.into_event(), + quic_version, + subscriber, + context, + } + } + } + impl<'a, Sub: Subscriber> ConnectionPublisher for ConnectionPublisherSubscriber<'a, Sub> { + #[inline] + fn on_stream_write_flushed(&self, event: builder::StreamWriteFlushed) { + let event = event.into_event(); + self.subscriber + .on_stream_write_flushed(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_write_blocked(&self, event: builder::StreamWriteBlocked) { + let event = event.into_event(); + self.subscriber + .on_stream_write_blocked(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_write_errored(&self, event: builder::StreamWriteErrored) { + let event = event.into_event(); + self.subscriber + .on_stream_write_errored(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_write_shutdown(&self, event: builder::StreamWriteShutdown) { + let event = event.into_event(); + self.subscriber + .on_stream_write_shutdown(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_write_socket_flushed(&self, event: builder::StreamWriteSocketFlushed) { + let event = event.into_event(); + self.subscriber + .on_stream_write_socket_flushed(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_write_socket_blocked(&self, event: builder::StreamWriteSocketBlocked) { + let event = event.into_event(); + self.subscriber + .on_stream_write_socket_blocked(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_write_socket_errored(&self, event: builder::StreamWriteSocketErrored) { + let event = event.into_event(); + self.subscriber + .on_stream_write_socket_errored(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_read_flushed(&self, event: builder::StreamReadFlushed) { + let event = event.into_event(); + self.subscriber + .on_stream_read_flushed(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_read_blocked(&self, event: builder::StreamReadBlocked) { + let event = event.into_event(); + self.subscriber + .on_stream_read_blocked(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_read_errored(&self, event: builder::StreamReadErrored) { + let event = event.into_event(); + self.subscriber + .on_stream_read_errored(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } #[inline] - pub fn new( - meta: builder::ConnectionMeta, - quic_version: u32, - subscriber: &'a Sub, - context: &'a Sub::ConnectionContext, - ) -> Self { - Self { - meta: meta.into_event(), - quic_version, - subscriber, - context, - } + fn on_stream_read_shutdown(&self, event: builder::StreamReadShutdown) { + let event = event.into_event(); + self.subscriber + .on_stream_read_shutdown(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); + } + #[inline] + fn on_stream_read_socket_flushed(&self, event: builder::StreamReadSocketFlushed) { + let event = event.into_event(); + self.subscriber + .on_stream_read_socket_flushed(self.context, &self.meta, &event); + self.subscriber + .on_connection_event(self.context, &self.meta, &event); + self.subscriber.on_event(&self.meta, &event); } - } - impl<'a, Sub: Subscriber> ConnectionPublisher for ConnectionPublisherSubscriber<'a, Sub> { #[inline] - fn on_application_write(&self, event: builder::ApplicationWrite) { + fn on_stream_read_socket_blocked(&self, event: builder::StreamReadSocketBlocked) { let event = event.into_event(); self.subscriber - .on_application_write(self.context, &self.meta, &event); + .on_stream_read_socket_blocked(self.context, &self.meta, &event); self.subscriber .on_connection_event(self.context, &self.meta, &event); self.subscriber.on_event(&self.meta, &event); } #[inline] - fn on_application_read(&self, event: builder::ApplicationRead) { + fn on_stream_read_socket_errored(&self, event: builder::StreamReadSocketErrored) { let event = event.into_event(); self.subscriber - .on_application_read(self.context, &self.meta, &event); + .on_stream_read_socket_errored(self.context, &self.meta, &event); self.subscriber .on_connection_event(self.context, &self.meta, &event); self.subscriber.on_event(&self.meta, &event); @@ -5867,8 +7125,20 @@ pub mod testing { pub acceptor_udp_io_error: AtomicU32, pub acceptor_stream_pruned: AtomicU32, pub acceptor_stream_dequeued: AtomicU32, - pub application_write: AtomicU32, - pub application_read: AtomicU32, + pub stream_write_flushed: AtomicU32, + pub stream_write_blocked: AtomicU32, + pub stream_write_errored: AtomicU32, + pub stream_write_shutdown: AtomicU32, + pub stream_write_socket_flushed: AtomicU32, + pub stream_write_socket_blocked: AtomicU32, + pub stream_write_socket_errored: AtomicU32, + pub stream_read_flushed: AtomicU32, + pub stream_read_blocked: AtomicU32, + pub stream_read_errored: AtomicU32, + pub stream_read_shutdown: AtomicU32, + pub stream_read_socket_flushed: AtomicU32, + pub stream_read_socket_blocked: AtomicU32, + pub stream_read_socket_errored: AtomicU32, pub endpoint_initialized: AtomicU32, pub path_secret_map_initialized: AtomicU32, pub path_secret_map_uninitialized: AtomicU32, @@ -5946,8 +7216,20 @@ pub mod testing { acceptor_udp_io_error: AtomicU32::new(0), acceptor_stream_pruned: AtomicU32::new(0), acceptor_stream_dequeued: AtomicU32::new(0), - application_write: AtomicU32::new(0), - application_read: AtomicU32::new(0), + stream_write_flushed: AtomicU32::new(0), + stream_write_blocked: AtomicU32::new(0), + stream_write_errored: AtomicU32::new(0), + stream_write_shutdown: AtomicU32::new(0), + stream_write_socket_flushed: AtomicU32::new(0), + stream_write_socket_blocked: AtomicU32::new(0), + stream_write_socket_errored: AtomicU32::new(0), + stream_read_flushed: AtomicU32::new(0), + stream_read_blocked: AtomicU32::new(0), + stream_read_errored: AtomicU32::new(0), + stream_read_shutdown: AtomicU32::new(0), + stream_read_socket_flushed: AtomicU32::new(0), + stream_read_socket_blocked: AtomicU32::new(0), + stream_read_socket_errored: AtomicU32::new(0), endpoint_initialized: AtomicU32::new(0), path_secret_map_initialized: AtomicU32::new(0), path_secret_map_uninitialized: AtomicU32::new(0), @@ -6198,13 +7480,186 @@ pub mod testing { let out = format!("{meta:?} {event:?}"); self.output.lock().unwrap().push(out); } - fn on_application_write( + fn on_stream_write_flushed( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteFlushed, + ) { + self.stream_write_flushed.fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_blocked( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteBlocked, + ) { + self.stream_write_blocked.fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_errored( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteErrored, + ) { + self.stream_write_errored.fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_shutdown( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteShutdown, + ) { + self.stream_write_shutdown.fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_socket_flushed( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketFlushed, + ) { + self.stream_write_socket_flushed + .fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_socket_blocked( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketBlocked, + ) { + self.stream_write_socket_blocked + .fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_socket_errored( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketErrored, + ) { + self.stream_write_socket_errored + .fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_flushed( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadFlushed, + ) { + self.stream_read_flushed.fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_blocked( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadBlocked, + ) { + self.stream_read_blocked.fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_errored( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadErrored, + ) { + self.stream_read_errored.fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_shutdown( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadShutdown, + ) { + self.stream_read_shutdown.fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_socket_flushed( + &self, + _context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadSocketFlushed, + ) { + self.stream_read_socket_flushed + .fetch_add(1, Ordering::Relaxed); + if self.location.is_some() { + let meta = crate::event::snapshot::Fmt::to_snapshot(meta); + let event = crate::event::snapshot::Fmt::to_snapshot(event); + let out = format!("{meta:?} {event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_socket_blocked( &self, _context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationWrite, + event: &api::StreamReadSocketBlocked, ) { - self.application_write.fetch_add(1, Ordering::Relaxed); + self.stream_read_socket_blocked + .fetch_add(1, Ordering::Relaxed); if self.location.is_some() { let meta = crate::event::snapshot::Fmt::to_snapshot(meta); let event = crate::event::snapshot::Fmt::to_snapshot(event); @@ -6212,13 +7667,14 @@ pub mod testing { self.output.lock().unwrap().push(out); } } - fn on_application_read( + fn on_stream_read_socket_errored( &self, _context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationRead, + event: &api::StreamReadSocketErrored, ) { - self.application_read.fetch_add(1, Ordering::Relaxed); + self.stream_read_socket_errored + .fetch_add(1, Ordering::Relaxed); if self.location.is_some() { let meta = crate::event::snapshot::Fmt::to_snapshot(meta); let event = crate::event::snapshot::Fmt::to_snapshot(event); @@ -6578,8 +8034,20 @@ pub mod testing { pub acceptor_udp_io_error: AtomicU32, pub acceptor_stream_pruned: AtomicU32, pub acceptor_stream_dequeued: AtomicU32, - pub application_write: AtomicU32, - pub application_read: AtomicU32, + pub stream_write_flushed: AtomicU32, + pub stream_write_blocked: AtomicU32, + pub stream_write_errored: AtomicU32, + pub stream_write_shutdown: AtomicU32, + pub stream_write_socket_flushed: AtomicU32, + pub stream_write_socket_blocked: AtomicU32, + pub stream_write_socket_errored: AtomicU32, + pub stream_read_flushed: AtomicU32, + pub stream_read_blocked: AtomicU32, + pub stream_read_errored: AtomicU32, + pub stream_read_shutdown: AtomicU32, + pub stream_read_socket_flushed: AtomicU32, + pub stream_read_socket_blocked: AtomicU32, + pub stream_read_socket_errored: AtomicU32, pub endpoint_initialized: AtomicU32, pub path_secret_map_initialized: AtomicU32, pub path_secret_map_uninitialized: AtomicU32, @@ -6647,8 +8115,20 @@ pub mod testing { acceptor_udp_io_error: AtomicU32::new(0), acceptor_stream_pruned: AtomicU32::new(0), acceptor_stream_dequeued: AtomicU32::new(0), - application_write: AtomicU32::new(0), - application_read: AtomicU32::new(0), + stream_write_flushed: AtomicU32::new(0), + stream_write_blocked: AtomicU32::new(0), + stream_write_errored: AtomicU32::new(0), + stream_write_shutdown: AtomicU32::new(0), + stream_write_socket_flushed: AtomicU32::new(0), + stream_write_socket_blocked: AtomicU32::new(0), + stream_write_socket_errored: AtomicU32::new(0), + stream_read_flushed: AtomicU32::new(0), + stream_read_blocked: AtomicU32::new(0), + stream_read_errored: AtomicU32::new(0), + stream_read_shutdown: AtomicU32::new(0), + stream_read_socket_flushed: AtomicU32::new(0), + stream_read_socket_blocked: AtomicU32::new(0), + stream_read_socket_errored: AtomicU32::new(0), endpoint_initialized: AtomicU32::new(0), path_secret_map_initialized: AtomicU32::new(0), path_secret_map_uninitialized: AtomicU32::new(0), @@ -7073,8 +8553,121 @@ pub mod testing { } } impl super::ConnectionPublisher for Publisher { - fn on_application_write(&self, event: builder::ApplicationWrite) { - self.application_write.fetch_add(1, Ordering::Relaxed); + fn on_stream_write_flushed(&self, event: builder::StreamWriteFlushed) { + self.stream_write_flushed.fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_blocked(&self, event: builder::StreamWriteBlocked) { + self.stream_write_blocked.fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_errored(&self, event: builder::StreamWriteErrored) { + self.stream_write_errored.fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_shutdown(&self, event: builder::StreamWriteShutdown) { + self.stream_write_shutdown.fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_socket_flushed(&self, event: builder::StreamWriteSocketFlushed) { + self.stream_write_socket_flushed + .fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_socket_blocked(&self, event: builder::StreamWriteSocketBlocked) { + self.stream_write_socket_blocked + .fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_write_socket_errored(&self, event: builder::StreamWriteSocketErrored) { + self.stream_write_socket_errored + .fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_flushed(&self, event: builder::StreamReadFlushed) { + self.stream_read_flushed.fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_blocked(&self, event: builder::StreamReadBlocked) { + self.stream_read_blocked.fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_errored(&self, event: builder::StreamReadErrored) { + self.stream_read_errored.fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_shutdown(&self, event: builder::StreamReadShutdown) { + self.stream_read_shutdown.fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_socket_flushed(&self, event: builder::StreamReadSocketFlushed) { + self.stream_read_socket_flushed + .fetch_add(1, Ordering::Relaxed); + let event = event.into_event(); + if self.location.is_some() { + let event = crate::event::snapshot::Fmt::to_snapshot(&event); + let out = format!("{event:?}"); + self.output.lock().unwrap().push(out); + } + } + fn on_stream_read_socket_blocked(&self, event: builder::StreamReadSocketBlocked) { + self.stream_read_socket_blocked + .fetch_add(1, Ordering::Relaxed); let event = event.into_event(); if self.location.is_some() { let event = crate::event::snapshot::Fmt::to_snapshot(&event); @@ -7082,8 +8675,9 @@ pub mod testing { self.output.lock().unwrap().push(out); } } - fn on_application_read(&self, event: builder::ApplicationRead) { - self.application_read.fetch_add(1, Ordering::Relaxed); + fn on_stream_read_socket_errored(&self, event: builder::StreamReadSocketErrored) { + self.stream_read_socket_errored + .fetch_add(1, Ordering::Relaxed); let event = event.into_event(); if self.location.is_some() { let event = crate::event::snapshot::Fmt::to_snapshot(&event); diff --git a/dc/s2n-quic-dc/src/event/generated/metrics.rs b/dc/s2n-quic-dc/src/event/generated/metrics.rs index 5a38b228f..89a564e66 100644 --- a/dc/s2n-quic-dc/src/event/generated/metrics.rs +++ b/dc/s2n-quic-dc/src/event/generated/metrics.rs @@ -26,8 +26,20 @@ where } pub struct Context { recorder: R, - application_write: AtomicU32, - application_read: AtomicU32, + stream_write_flushed: AtomicU32, + stream_write_blocked: AtomicU32, + stream_write_errored: AtomicU32, + stream_write_shutdown: AtomicU32, + stream_write_socket_flushed: AtomicU32, + stream_write_socket_blocked: AtomicU32, + stream_write_socket_errored: AtomicU32, + stream_read_flushed: AtomicU32, + stream_read_blocked: AtomicU32, + stream_read_errored: AtomicU32, + stream_read_shutdown: AtomicU32, + stream_read_socket_flushed: AtomicU32, + stream_read_socket_blocked: AtomicU32, + stream_read_socket_errored: AtomicU32, } impl event::Subscriber for Subscriber where @@ -41,42 +53,248 @@ where ) -> Self::ConnectionContext { Context { recorder: self.subscriber.create_connection_context(meta, info), - application_write: AtomicU32::new(0), - application_read: AtomicU32::new(0), + stream_write_flushed: AtomicU32::new(0), + stream_write_blocked: AtomicU32::new(0), + stream_write_errored: AtomicU32::new(0), + stream_write_shutdown: AtomicU32::new(0), + stream_write_socket_flushed: AtomicU32::new(0), + stream_write_socket_blocked: AtomicU32::new(0), + stream_write_socket_errored: AtomicU32::new(0), + stream_read_flushed: AtomicU32::new(0), + stream_read_blocked: AtomicU32::new(0), + stream_read_errored: AtomicU32::new(0), + stream_read_shutdown: AtomicU32::new(0), + stream_read_socket_flushed: AtomicU32::new(0), + stream_read_socket_blocked: AtomicU32::new(0), + stream_read_socket_errored: AtomicU32::new(0), } } #[inline] - fn on_application_write( + fn on_stream_write_flushed( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationWrite, + event: &api::StreamWriteFlushed, ) { - context.application_write.fetch_add(1, Ordering::Relaxed); + context.stream_write_flushed.fetch_add(1, Ordering::Relaxed); self.subscriber - .on_application_write(&context.recorder, meta, event); + .on_stream_write_flushed(&context.recorder, meta, event); } #[inline] - fn on_application_read( + fn on_stream_write_blocked( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationRead, + event: &api::StreamWriteBlocked, ) { - context.application_read.fetch_add(1, Ordering::Relaxed); + context.stream_write_blocked.fetch_add(1, Ordering::Relaxed); self.subscriber - .on_application_read(&context.recorder, meta, event); + .on_stream_write_blocked(&context.recorder, meta, event); + } + #[inline] + fn on_stream_write_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteErrored, + ) { + context.stream_write_errored.fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_write_errored(&context.recorder, meta, event); + } + #[inline] + fn on_stream_write_shutdown( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteShutdown, + ) { + context + .stream_write_shutdown + .fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_write_shutdown(&context.recorder, meta, event); + } + #[inline] + fn on_stream_write_socket_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketFlushed, + ) { + context + .stream_write_socket_flushed + .fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_write_socket_flushed(&context.recorder, meta, event); + } + #[inline] + fn on_stream_write_socket_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketBlocked, + ) { + context + .stream_write_socket_blocked + .fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_write_socket_blocked(&context.recorder, meta, event); + } + #[inline] + fn on_stream_write_socket_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketErrored, + ) { + context + .stream_write_socket_errored + .fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_write_socket_errored(&context.recorder, meta, event); + } + #[inline] + fn on_stream_read_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadFlushed, + ) { + context.stream_read_flushed.fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_read_flushed(&context.recorder, meta, event); + } + #[inline] + fn on_stream_read_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadBlocked, + ) { + context.stream_read_blocked.fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_read_blocked(&context.recorder, meta, event); + } + #[inline] + fn on_stream_read_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadErrored, + ) { + context.stream_read_errored.fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_read_errored(&context.recorder, meta, event); + } + #[inline] + fn on_stream_read_shutdown( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadShutdown, + ) { + context.stream_read_shutdown.fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_read_shutdown(&context.recorder, meta, event); + } + #[inline] + fn on_stream_read_socket_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadSocketFlushed, + ) { + context + .stream_read_socket_flushed + .fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_read_socket_flushed(&context.recorder, meta, event); + } + #[inline] + fn on_stream_read_socket_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadSocketBlocked, + ) { + context + .stream_read_socket_blocked + .fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_read_socket_blocked(&context.recorder, meta, event); + } + #[inline] + fn on_stream_read_socket_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadSocketErrored, + ) { + context + .stream_read_socket_errored + .fetch_add(1, Ordering::Relaxed); + self.subscriber + .on_stream_read_socket_errored(&context.recorder, meta, event); } } impl Drop for Context { fn drop(&mut self) { self.recorder.increment_counter( - "application_write", - self.application_write.load(Ordering::Relaxed) as _, + "stream_write_flushed", + self.stream_write_flushed.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_write_blocked", + self.stream_write_blocked.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_write_errored", + self.stream_write_errored.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_write_shutdown", + self.stream_write_shutdown.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_write_socket_flushed", + self.stream_write_socket_flushed.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_write_socket_blocked", + self.stream_write_socket_blocked.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_write_socket_errored", + self.stream_write_socket_errored.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_read_flushed", + self.stream_read_flushed.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_read_blocked", + self.stream_read_blocked.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_read_errored", + self.stream_read_errored.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_read_shutdown", + self.stream_read_shutdown.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_read_socket_flushed", + self.stream_read_socket_flushed.load(Ordering::Relaxed) as _, + ); + self.recorder.increment_counter( + "stream_read_socket_blocked", + self.stream_read_socket_blocked.load(Ordering::Relaxed) as _, ); self.recorder.increment_counter( - "application_read", - self.application_read.load(Ordering::Relaxed) as _, + "stream_read_socket_errored", + self.stream_read_socket_errored.load(Ordering::Relaxed) as _, ); } } diff --git a/dc/s2n-quic-dc/src/event/generated/metrics/aggregate.rs b/dc/s2n-quic-dc/src/event/generated/metrics/aggregate.rs index c1e767ed2..4ea19cf7b 100644 --- a/dc/s2n-quic-dc/src/event/generated/metrics/aggregate.rs +++ b/dc/s2n-quic-dc/src/event/generated/metrics/aggregate.rs @@ -12,7 +12,7 @@ use crate::event::{ AsVariant, BoolRecorder, Info, Metric, NominalRecorder, Recorder, Registry, Units, }, }; -static INFO: &[Info; 126usize] = &[ +static INFO: &[Info; 170usize] = &[ info::Builder { id: 0usize, name: Str::new("acceptor_tcp_started\0"), @@ -297,474 +297,738 @@ static INFO: &[Info; 126usize] = &[ .build(), info::Builder { id: 47usize, - name: Str::new("application_write\0"), + name: Str::new("stream_write_flushed\0"), units: Units::None, } .build(), info::Builder { id: 48usize, - name: Str::new("application_write.provided\0"), + name: Str::new("stream_write_flushed.provided\0"), units: Units::Bytes, } .build(), info::Builder { id: 49usize, - name: Str::new("application_write.committed.total\0"), + name: Str::new("stream_write_flushed.committed.total\0"), units: Units::Bytes, } .build(), info::Builder { id: 50usize, - name: Str::new("application_write.committed\0"), + name: Str::new("stream_write_flushed.committed\0"), units: Units::Bytes, } .build(), info::Builder { id: 51usize, - name: Str::new("application_read\0"), + name: Str::new("stream_write_flushed.is_fin\0"), units: Units::None, } .build(), info::Builder { id: 52usize, - name: Str::new("application_read.capacity\0"), - units: Units::Bytes, + name: Str::new("stream_write_flushed.processing_duration\0"), + units: Units::Duration, } .build(), info::Builder { id: 53usize, - name: Str::new("application_read.committed.total\0"), - units: Units::Bytes, + name: Str::new("stream_write_blocked\0"), + units: Units::None, } .build(), info::Builder { id: 54usize, - name: Str::new("application_read.committed\0"), + name: Str::new("stream_write_blocked.provided\0"), units: Units::Bytes, } .build(), info::Builder { id: 55usize, - name: Str::new("endpoint_initialized\0"), + name: Str::new("stream_write_blocked.is_fin\0"), units: Units::None, } .build(), info::Builder { id: 56usize, + name: Str::new("stream_write_blocked.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 57usize, + name: Str::new("stream_write_errored\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 58usize, + name: Str::new("stream_write_errored.provided\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 59usize, + name: Str::new("stream_write_errored.is_fin\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 60usize, + name: Str::new("stream_write_errored.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 61usize, + name: Str::new("stream_write_shutdown\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 62usize, + name: Str::new("stream_write_shutdown.buffer_len\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 63usize, + name: Str::new("stream_write_shutdown.background\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 64usize, + name: Str::new("stream_write_socket_flushed\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 65usize, + name: Str::new("stream_write_socket_flushed.provided\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 66usize, + name: Str::new("stream_write_socket_flushed.committed.total\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 67usize, + name: Str::new("stream_write_socket_flushed.committed\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 68usize, + name: Str::new("stream_write_socket_flushed.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 69usize, + name: Str::new("stream_write_socket_blocked\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 70usize, + name: Str::new("stream_write_socket_blocked.provided\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 71usize, + name: Str::new("stream_write_socket_blocked.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 72usize, + name: Str::new("stream_write_socket_errored\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 73usize, + name: Str::new("stream_write_socket_errored.provided\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 74usize, + name: Str::new("stream_write_socket_errored.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 75usize, + name: Str::new("stream_read_flushed\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 76usize, + name: Str::new("stream_read_flushed.capacity\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 77usize, + name: Str::new("stream_read_flushed.committed.total\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 78usize, + name: Str::new("stream_read_flushed.committed\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 79usize, + name: Str::new("stream_read_flushed.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 80usize, + name: Str::new("stream_read_blocked\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 81usize, + name: Str::new("stream_read_blocked.capacity\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 82usize, + name: Str::new("stream_read_blocked.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 83usize, + name: Str::new("stream_read_errored\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 84usize, + name: Str::new("stream_read_errored.capacity\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 85usize, + name: Str::new("stream_read_errored.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 86usize, + name: Str::new("stream_read_shutdown\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 87usize, + name: Str::new("stream_read_shutdown.background\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 88usize, + name: Str::new("stream_read_socket_flushed\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 89usize, + name: Str::new("stream_read_socket_flushed.capacity\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 90usize, + name: Str::new("stream_read_socket_flushed.committed.total\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 91usize, + name: Str::new("stream_read_socket_flushed.committed\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 92usize, + name: Str::new("stream_read_socket_flushed.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 93usize, + name: Str::new("stream_read_socket_blocked\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 94usize, + name: Str::new("stream_read_socket_blocked.capacity\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 95usize, + name: Str::new("stream_read_socket_blocked.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 96usize, + name: Str::new("stream_read_socket_errored\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 97usize, + name: Str::new("stream_read_socket_errored.capacity\0"), + units: Units::Bytes, + } + .build(), + info::Builder { + id: 98usize, + name: Str::new("stream_read_socket_errored.processing_duration\0"), + units: Units::Duration, + } + .build(), + info::Builder { + id: 99usize, + name: Str::new("endpoint_initialized\0"), + units: Units::None, + } + .build(), + info::Builder { + id: 100usize, name: Str::new("endpoint_initialized.acceptor.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 57usize, + id: 101usize, name: Str::new("endpoint_initialized.handshake.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 58usize, + id: 102usize, name: Str::new("endpoint_initialized.tcp\0"), units: Units::None, } .build(), info::Builder { - id: 59usize, + id: 103usize, name: Str::new("endpoint_initialized.udp\0"), units: Units::None, } .build(), info::Builder { - id: 60usize, + id: 104usize, name: Str::new("path_secret_map_initialized\0"), units: Units::None, } .build(), info::Builder { - id: 61usize, + id: 105usize, name: Str::new("path_secret_map_initialized.capacity\0"), units: Units::None, } .build(), info::Builder { - id: 62usize, + id: 106usize, name: Str::new("path_secret_map_uninitialized\0"), units: Units::None, } .build(), info::Builder { - id: 63usize, + id: 107usize, name: Str::new("path_secret_map_uninitialized.capacity\0"), units: Units::None, } .build(), info::Builder { - id: 64usize, + id: 108usize, name: Str::new("path_secret_map_uninitialized.entries\0"), units: Units::None, } .build(), info::Builder { - id: 65usize, + id: 109usize, name: Str::new("path_secret_map_uninitialized.lifetime\0"), units: Units::Duration, } .build(), info::Builder { - id: 66usize, + id: 110usize, name: Str::new("path_secret_map_background_handshake_requested\0"), units: Units::None, } .build(), info::Builder { - id: 67usize, + id: 111usize, name: Str::new("path_secret_map_background_handshake_requested.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 68usize, + id: 112usize, name: Str::new("path_secret_map_entry_inserted\0"), units: Units::None, } .build(), info::Builder { - id: 69usize, + id: 113usize, name: Str::new("path_secret_map_entry_inserted.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 70usize, + id: 114usize, name: Str::new("path_secret_map_entry_ready\0"), units: Units::None, } .build(), info::Builder { - id: 71usize, + id: 115usize, name: Str::new("path_secret_map_entry_ready.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 72usize, + id: 116usize, name: Str::new("path_secret_map_entry_replaced\0"), units: Units::None, } .build(), info::Builder { - id: 73usize, + id: 117usize, name: Str::new("path_secret_map_entry_replaced.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 74usize, + id: 118usize, name: Str::new("unknown_path_secret_packet_sent\0"), units: Units::None, } .build(), info::Builder { - id: 75usize, + id: 119usize, name: Str::new("unknown_path_secret_packet_sent.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 76usize, + id: 120usize, name: Str::new("unknown_path_secret_packet_received\0"), units: Units::None, } .build(), info::Builder { - id: 77usize, + id: 121usize, name: Str::new("unknown_path_secret_packet_received.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 78usize, + id: 122usize, name: Str::new("unknown_path_secret_packet_accepted\0"), units: Units::None, } .build(), info::Builder { - id: 79usize, + id: 123usize, name: Str::new("unknown_path_secret_packet_accepted.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 80usize, + id: 124usize, name: Str::new("unknown_path_secret_packet_rejected\0"), units: Units::None, } .build(), info::Builder { - id: 81usize, + id: 125usize, name: Str::new("unknown_path_secret_packet_rejected.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 82usize, + id: 126usize, name: Str::new("unknown_path_secret_packet_dropped\0"), units: Units::None, } .build(), info::Builder { - id: 83usize, + id: 127usize, name: Str::new("unknown_path_secret_packet_dropped.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 84usize, + id: 128usize, name: Str::new("key_accepted\0"), units: Units::None, } .build(), info::Builder { - id: 85usize, + id: 129usize, name: Str::new("key_accepted.gap\0"), units: Units::None, } .build(), info::Builder { - id: 86usize, + id: 130usize, name: Str::new("key_accepted.forward_shift\0"), units: Units::None, } .build(), info::Builder { - id: 87usize, + id: 131usize, name: Str::new("replay_definitely_detected\0"), units: Units::None, } .build(), info::Builder { - id: 88usize, + id: 132usize, name: Str::new("replay_potentially_detected\0"), units: Units::None, } .build(), info::Builder { - id: 89usize, + id: 133usize, name: Str::new("replay_potentially_detected.gap\0"), units: Units::None, } .build(), info::Builder { - id: 90usize, + id: 134usize, name: Str::new("replay_detected_packet_sent\0"), units: Units::None, } .build(), info::Builder { - id: 91usize, + id: 135usize, name: Str::new("replay_detected_packet_sent.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 92usize, + id: 136usize, name: Str::new("replay_detected_packet_received\0"), units: Units::None, } .build(), info::Builder { - id: 93usize, + id: 137usize, name: Str::new("replay_detected_packet_received.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 94usize, + id: 138usize, name: Str::new("replay_detected_packet_accepted\0"), units: Units::None, } .build(), info::Builder { - id: 95usize, + id: 139usize, name: Str::new("replay_detected_packet_accepted.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 96usize, + id: 140usize, name: Str::new("replay_detected_packet_rejected\0"), units: Units::None, } .build(), info::Builder { - id: 97usize, + id: 141usize, name: Str::new("replay_detected_packet_rejected.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 98usize, + id: 142usize, name: Str::new("replay_detected_packet_dropped\0"), units: Units::None, } .build(), info::Builder { - id: 99usize, + id: 143usize, name: Str::new("replay_detected_packet_dropped.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 100usize, + id: 144usize, name: Str::new("stale_key_packet_sent\0"), units: Units::None, } .build(), info::Builder { - id: 101usize, + id: 145usize, name: Str::new("stale_key_packet_sent.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 102usize, + id: 146usize, name: Str::new("stale_key_packet_received\0"), units: Units::None, } .build(), info::Builder { - id: 103usize, + id: 147usize, name: Str::new("stale_key_packet_received.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 104usize, + id: 148usize, name: Str::new("stale_key_packet_accepted\0"), units: Units::None, } .build(), info::Builder { - id: 105usize, + id: 149usize, name: Str::new("stale_key_packet_accepted.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 106usize, + id: 150usize, name: Str::new("stale_key_packet_rejected\0"), units: Units::None, } .build(), info::Builder { - id: 107usize, + id: 151usize, name: Str::new("stale_key_packet_rejected.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 108usize, + id: 152usize, name: Str::new("stale_key_packet_dropped\0"), units: Units::None, } .build(), info::Builder { - id: 109usize, + id: 153usize, name: Str::new("stale_key_packet_dropped.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 110usize, + id: 154usize, name: Str::new("path_secret_map_address_cache_accessed\0"), units: Units::None, } .build(), info::Builder { - id: 111usize, + id: 155usize, name: Str::new("path_secret_map_address_cache_accessed.peer_address.protocol\0"), units: Units::None, } .build(), info::Builder { - id: 112usize, + id: 156usize, name: Str::new("path_secret_map_address_cache_accessed.hit\0"), units: Units::None, } .build(), info::Builder { - id: 113usize, + id: 157usize, name: Str::new("path_secret_map_id_cache_accessed\0"), units: Units::None, } .build(), info::Builder { - id: 114usize, + id: 158usize, name: Str::new("path_secret_map_id_cache_accessed.hit\0"), units: Units::None, } .build(), info::Builder { - id: 115usize, + id: 159usize, name: Str::new("path_secret_map_cleaner_cycled\0"), units: Units::None, } .build(), info::Builder { - id: 116usize, + id: 160usize, name: Str::new("path_secret_map_cleaner_cycled.entries.id\0"), units: Units::None, } .build(), info::Builder { - id: 117usize, + id: 161usize, name: Str::new("path_secret_map_cleaner_cycled.entries.id.retired\0"), units: Units::None, } .build(), info::Builder { - id: 118usize, + id: 162usize, name: Str::new("path_secret_map_cleaner_cycled.entries.id.utilization\0"), units: Units::Percent, } .build(), info::Builder { - id: 119usize, + id: 163usize, name: Str::new("path_secret_map_cleaner_cycled.entries.id.utilization.initial\0"), units: Units::Percent, } .build(), info::Builder { - id: 120usize, + id: 164usize, name: Str::new("path_secret_map_cleaner_cycled.entries.address\0"), units: Units::None, } .build(), info::Builder { - id: 121usize, + id: 165usize, name: Str::new("path_secret_map_cleaner_cycled.entries.address.retired\0"), units: Units::None, } .build(), info::Builder { - id: 122usize, + id: 166usize, name: Str::new("path_secret_map_cleaner_cycled.entries.address.utilization\0"), units: Units::Percent, } .build(), info::Builder { - id: 123usize, + id: 167usize, name: Str::new("path_secret_map_cleaner_cycled.entries.address.utilization.initial\0"), units: Units::Percent, } .build(), info::Builder { - id: 124usize, + id: 168usize, name: Str::new("path_secret_map_cleaner_cycled.handshake_requests\0"), units: Units::None, } .build(), info::Builder { - id: 125usize, + id: 169usize, name: Str::new("path_secret_map_cleaner_cycled.handshake_requests.retired\0"), units: Units::None, } @@ -777,15 +1041,15 @@ pub struct ConnectionContext { } pub struct Subscriber { #[allow(dead_code)] - counters: Box<[R::Counter; 50usize]>, + counters: Box<[R::Counter; 64usize]>, #[allow(dead_code)] - bool_counters: Box<[R::BoolCounter; 10usize]>, + bool_counters: Box<[R::BoolCounter; 15usize]>, #[allow(dead_code)] nominal_counters: Box<[R::NominalCounter]>, #[allow(dead_code)] nominal_counter_offsets: Box<[usize; 26usize]>, #[allow(dead_code)] - measures: Box<[R::Measure; 33usize]>, + measures: Box<[R::Measure; 58usize]>, #[allow(dead_code)] gauges: Box<[R::Gauge; 0usize]>, #[allow(dead_code)] @@ -812,11 +1076,11 @@ impl Subscriber { #[allow(unused_mut)] #[inline] pub fn new(registry: R) -> Self { - let mut counters = Vec::with_capacity(50usize); - let mut bool_counters = Vec::with_capacity(10usize); + let mut counters = Vec::with_capacity(64usize); + let mut bool_counters = Vec::with_capacity(15usize); let mut nominal_counters = Vec::with_capacity(26usize); let mut nominal_counter_offsets = Vec::with_capacity(26usize); - let mut measures = Vec::with_capacity(33usize); + let mut measures = Vec::with_capacity(58usize); let mut gauges = Vec::with_capacity(0usize); let mut timers = Vec::with_capacity(7usize); let mut nominal_timers = Vec::with_capacity(0usize); @@ -841,46 +1105,65 @@ impl Subscriber { counters.push(registry.register_counter(&INFO[45usize])); counters.push(registry.register_counter(&INFO[47usize])); counters.push(registry.register_counter(&INFO[49usize])); - counters.push(registry.register_counter(&INFO[51usize])); counters.push(registry.register_counter(&INFO[53usize])); - counters.push(registry.register_counter(&INFO[55usize])); - counters.push(registry.register_counter(&INFO[60usize])); - counters.push(registry.register_counter(&INFO[62usize])); + counters.push(registry.register_counter(&INFO[57usize])); + counters.push(registry.register_counter(&INFO[61usize])); + counters.push(registry.register_counter(&INFO[64usize])); counters.push(registry.register_counter(&INFO[66usize])); - counters.push(registry.register_counter(&INFO[68usize])); - counters.push(registry.register_counter(&INFO[70usize])); + counters.push(registry.register_counter(&INFO[69usize])); counters.push(registry.register_counter(&INFO[72usize])); - counters.push(registry.register_counter(&INFO[74usize])); - counters.push(registry.register_counter(&INFO[76usize])); - counters.push(registry.register_counter(&INFO[78usize])); + counters.push(registry.register_counter(&INFO[75usize])); + counters.push(registry.register_counter(&INFO[77usize])); counters.push(registry.register_counter(&INFO[80usize])); - counters.push(registry.register_counter(&INFO[82usize])); - counters.push(registry.register_counter(&INFO[84usize])); - counters.push(registry.register_counter(&INFO[87usize])); + counters.push(registry.register_counter(&INFO[83usize])); + counters.push(registry.register_counter(&INFO[86usize])); counters.push(registry.register_counter(&INFO[88usize])); counters.push(registry.register_counter(&INFO[90usize])); - counters.push(registry.register_counter(&INFO[92usize])); - counters.push(registry.register_counter(&INFO[94usize])); + counters.push(registry.register_counter(&INFO[93usize])); counters.push(registry.register_counter(&INFO[96usize])); - counters.push(registry.register_counter(&INFO[98usize])); - counters.push(registry.register_counter(&INFO[100usize])); - counters.push(registry.register_counter(&INFO[102usize])); + counters.push(registry.register_counter(&INFO[99usize])); counters.push(registry.register_counter(&INFO[104usize])); counters.push(registry.register_counter(&INFO[106usize])); - counters.push(registry.register_counter(&INFO[108usize])); counters.push(registry.register_counter(&INFO[110usize])); - counters.push(registry.register_counter(&INFO[113usize])); - counters.push(registry.register_counter(&INFO[115usize])); + counters.push(registry.register_counter(&INFO[112usize])); + counters.push(registry.register_counter(&INFO[114usize])); + counters.push(registry.register_counter(&INFO[116usize])); + counters.push(registry.register_counter(&INFO[118usize])); + counters.push(registry.register_counter(&INFO[120usize])); + counters.push(registry.register_counter(&INFO[122usize])); + counters.push(registry.register_counter(&INFO[124usize])); + counters.push(registry.register_counter(&INFO[126usize])); + counters.push(registry.register_counter(&INFO[128usize])); + counters.push(registry.register_counter(&INFO[131usize])); + counters.push(registry.register_counter(&INFO[132usize])); + counters.push(registry.register_counter(&INFO[134usize])); + counters.push(registry.register_counter(&INFO[136usize])); + counters.push(registry.register_counter(&INFO[138usize])); + counters.push(registry.register_counter(&INFO[140usize])); + counters.push(registry.register_counter(&INFO[142usize])); + counters.push(registry.register_counter(&INFO[144usize])); + counters.push(registry.register_counter(&INFO[146usize])); + counters.push(registry.register_counter(&INFO[148usize])); + counters.push(registry.register_counter(&INFO[150usize])); + counters.push(registry.register_counter(&INFO[152usize])); + counters.push(registry.register_counter(&INFO[154usize])); + counters.push(registry.register_counter(&INFO[157usize])); + counters.push(registry.register_counter(&INFO[159usize])); bool_counters.push(registry.register_bool_counter(&INFO[19usize])); bool_counters.push(registry.register_bool_counter(&INFO[20usize])); bool_counters.push(registry.register_bool_counter(&INFO[34usize])); bool_counters.push(registry.register_bool_counter(&INFO[35usize])); bool_counters.push(registry.register_bool_counter(&INFO[36usize])); bool_counters.push(registry.register_bool_counter(&INFO[37usize])); - bool_counters.push(registry.register_bool_counter(&INFO[58usize])); + bool_counters.push(registry.register_bool_counter(&INFO[51usize])); + bool_counters.push(registry.register_bool_counter(&INFO[55usize])); bool_counters.push(registry.register_bool_counter(&INFO[59usize])); - bool_counters.push(registry.register_bool_counter(&INFO[112usize])); - bool_counters.push(registry.register_bool_counter(&INFO[114usize])); + bool_counters.push(registry.register_bool_counter(&INFO[63usize])); + bool_counters.push(registry.register_bool_counter(&INFO[87usize])); + bool_counters.push(registry.register_bool_counter(&INFO[102usize])); + bool_counters.push(registry.register_bool_counter(&INFO[103usize])); + bool_counters.push(registry.register_bool_counter(&INFO[156usize])); + bool_counters.push(registry.register_bool_counter(&INFO[158usize])); { #[allow(unused_imports)] use api::*; @@ -933,7 +1216,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[56usize], variant)); + .push(registry.register_nominal_counter(&INFO[100usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -944,7 +1227,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[57usize], variant)); + .push(registry.register_nominal_counter(&INFO[101usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -955,7 +1238,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[67usize], variant)); + .push(registry.register_nominal_counter(&INFO[111usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -966,7 +1249,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[69usize], variant)); + .push(registry.register_nominal_counter(&INFO[113usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -977,7 +1260,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[71usize], variant)); + .push(registry.register_nominal_counter(&INFO[115usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -988,7 +1271,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[73usize], variant)); + .push(registry.register_nominal_counter(&INFO[117usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -999,7 +1282,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[75usize], variant)); + .push(registry.register_nominal_counter(&INFO[119usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1010,7 +1293,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[77usize], variant)); + .push(registry.register_nominal_counter(&INFO[121usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1021,7 +1304,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[79usize], variant)); + .push(registry.register_nominal_counter(&INFO[123usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1032,7 +1315,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[81usize], variant)); + .push(registry.register_nominal_counter(&INFO[125usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1043,7 +1326,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[83usize], variant)); + .push(registry.register_nominal_counter(&INFO[127usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1054,7 +1337,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[91usize], variant)); + .push(registry.register_nominal_counter(&INFO[135usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1065,7 +1348,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[93usize], variant)); + .push(registry.register_nominal_counter(&INFO[137usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1076,7 +1359,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[95usize], variant)); + .push(registry.register_nominal_counter(&INFO[139usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1087,7 +1370,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[97usize], variant)); + .push(registry.register_nominal_counter(&INFO[141usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1098,7 +1381,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[99usize], variant)); + .push(registry.register_nominal_counter(&INFO[143usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1109,7 +1392,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[101usize], variant)); + .push(registry.register_nominal_counter(&INFO[145usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1120,7 +1403,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[103usize], variant)); + .push(registry.register_nominal_counter(&INFO[147usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1131,7 +1414,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[105usize], variant)); + .push(registry.register_nominal_counter(&INFO[149usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1142,7 +1425,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[107usize], variant)); + .push(registry.register_nominal_counter(&INFO[151usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1153,7 +1436,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[109usize], variant)); + .push(registry.register_nominal_counter(&INFO[153usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1164,7 +1447,7 @@ impl Subscriber { let mut count = 0; for variant in ::VARIANTS.iter() { nominal_counters - .push(registry.register_nominal_counter(&INFO[111usize], variant)); + .push(registry.register_nominal_counter(&INFO[155usize], variant)); count += 1; } debug_assert_ne!(count, 0, "field type needs at least one variant"); @@ -1187,23 +1470,48 @@ impl Subscriber { measures.push(registry.register_measure(&INFO[50usize])); measures.push(registry.register_measure(&INFO[52usize])); measures.push(registry.register_measure(&INFO[54usize])); - measures.push(registry.register_measure(&INFO[61usize])); - measures.push(registry.register_measure(&INFO[63usize])); - measures.push(registry.register_measure(&INFO[64usize])); + measures.push(registry.register_measure(&INFO[56usize])); + measures.push(registry.register_measure(&INFO[58usize])); + measures.push(registry.register_measure(&INFO[60usize])); + measures.push(registry.register_measure(&INFO[62usize])); measures.push(registry.register_measure(&INFO[65usize])); + measures.push(registry.register_measure(&INFO[67usize])); + measures.push(registry.register_measure(&INFO[68usize])); + measures.push(registry.register_measure(&INFO[70usize])); + measures.push(registry.register_measure(&INFO[71usize])); + measures.push(registry.register_measure(&INFO[73usize])); + measures.push(registry.register_measure(&INFO[74usize])); + measures.push(registry.register_measure(&INFO[76usize])); + measures.push(registry.register_measure(&INFO[78usize])); + measures.push(registry.register_measure(&INFO[79usize])); + measures.push(registry.register_measure(&INFO[81usize])); + measures.push(registry.register_measure(&INFO[82usize])); + measures.push(registry.register_measure(&INFO[84usize])); measures.push(registry.register_measure(&INFO[85usize])); - measures.push(registry.register_measure(&INFO[86usize])); measures.push(registry.register_measure(&INFO[89usize])); - measures.push(registry.register_measure(&INFO[116usize])); - measures.push(registry.register_measure(&INFO[117usize])); - measures.push(registry.register_measure(&INFO[118usize])); - measures.push(registry.register_measure(&INFO[119usize])); - measures.push(registry.register_measure(&INFO[120usize])); - measures.push(registry.register_measure(&INFO[121usize])); - measures.push(registry.register_measure(&INFO[122usize])); - measures.push(registry.register_measure(&INFO[123usize])); - measures.push(registry.register_measure(&INFO[124usize])); - measures.push(registry.register_measure(&INFO[125usize])); + measures.push(registry.register_measure(&INFO[91usize])); + measures.push(registry.register_measure(&INFO[92usize])); + measures.push(registry.register_measure(&INFO[94usize])); + measures.push(registry.register_measure(&INFO[95usize])); + measures.push(registry.register_measure(&INFO[97usize])); + measures.push(registry.register_measure(&INFO[98usize])); + measures.push(registry.register_measure(&INFO[105usize])); + measures.push(registry.register_measure(&INFO[107usize])); + measures.push(registry.register_measure(&INFO[108usize])); + measures.push(registry.register_measure(&INFO[109usize])); + measures.push(registry.register_measure(&INFO[129usize])); + measures.push(registry.register_measure(&INFO[130usize])); + measures.push(registry.register_measure(&INFO[133usize])); + measures.push(registry.register_measure(&INFO[160usize])); + measures.push(registry.register_measure(&INFO[161usize])); + measures.push(registry.register_measure(&INFO[162usize])); + measures.push(registry.register_measure(&INFO[163usize])); + measures.push(registry.register_measure(&INFO[164usize])); + measures.push(registry.register_measure(&INFO[165usize])); + measures.push(registry.register_measure(&INFO[166usize])); + measures.push(registry.register_measure(&INFO[167usize])); + measures.push(registry.register_measure(&INFO[168usize])); + measures.push(registry.register_measure(&INFO[169usize])); timers.push(registry.register_timer(&INFO[5usize])); timers.push(registry.register_timer(&INFO[15usize])); timers.push(registry.register_timer(&INFO[21usize])); @@ -1265,36 +1573,50 @@ impl Subscriber { 17usize => (&INFO[45usize], entry), 18usize => (&INFO[47usize], entry), 19usize => (&INFO[49usize], entry), - 20usize => (&INFO[51usize], entry), - 21usize => (&INFO[53usize], entry), - 22usize => (&INFO[55usize], entry), - 23usize => (&INFO[60usize], entry), - 24usize => (&INFO[62usize], entry), - 25usize => (&INFO[66usize], entry), - 26usize => (&INFO[68usize], entry), - 27usize => (&INFO[70usize], entry), - 28usize => (&INFO[72usize], entry), - 29usize => (&INFO[74usize], entry), - 30usize => (&INFO[76usize], entry), - 31usize => (&INFO[78usize], entry), - 32usize => (&INFO[80usize], entry), - 33usize => (&INFO[82usize], entry), - 34usize => (&INFO[84usize], entry), - 35usize => (&INFO[87usize], entry), - 36usize => (&INFO[88usize], entry), - 37usize => (&INFO[90usize], entry), - 38usize => (&INFO[92usize], entry), - 39usize => (&INFO[94usize], entry), - 40usize => (&INFO[96usize], entry), - 41usize => (&INFO[98usize], entry), - 42usize => (&INFO[100usize], entry), - 43usize => (&INFO[102usize], entry), - 44usize => (&INFO[104usize], entry), - 45usize => (&INFO[106usize], entry), - 46usize => (&INFO[108usize], entry), - 47usize => (&INFO[110usize], entry), - 48usize => (&INFO[113usize], entry), - 49usize => (&INFO[115usize], entry), + 20usize => (&INFO[53usize], entry), + 21usize => (&INFO[57usize], entry), + 22usize => (&INFO[61usize], entry), + 23usize => (&INFO[64usize], entry), + 24usize => (&INFO[66usize], entry), + 25usize => (&INFO[69usize], entry), + 26usize => (&INFO[72usize], entry), + 27usize => (&INFO[75usize], entry), + 28usize => (&INFO[77usize], entry), + 29usize => (&INFO[80usize], entry), + 30usize => (&INFO[83usize], entry), + 31usize => (&INFO[86usize], entry), + 32usize => (&INFO[88usize], entry), + 33usize => (&INFO[90usize], entry), + 34usize => (&INFO[93usize], entry), + 35usize => (&INFO[96usize], entry), + 36usize => (&INFO[99usize], entry), + 37usize => (&INFO[104usize], entry), + 38usize => (&INFO[106usize], entry), + 39usize => (&INFO[110usize], entry), + 40usize => (&INFO[112usize], entry), + 41usize => (&INFO[114usize], entry), + 42usize => (&INFO[116usize], entry), + 43usize => (&INFO[118usize], entry), + 44usize => (&INFO[120usize], entry), + 45usize => (&INFO[122usize], entry), + 46usize => (&INFO[124usize], entry), + 47usize => (&INFO[126usize], entry), + 48usize => (&INFO[128usize], entry), + 49usize => (&INFO[131usize], entry), + 50usize => (&INFO[132usize], entry), + 51usize => (&INFO[134usize], entry), + 52usize => (&INFO[136usize], entry), + 53usize => (&INFO[138usize], entry), + 54usize => (&INFO[140usize], entry), + 55usize => (&INFO[142usize], entry), + 56usize => (&INFO[144usize], entry), + 57usize => (&INFO[146usize], entry), + 58usize => (&INFO[148usize], entry), + 59usize => (&INFO[150usize], entry), + 60usize => (&INFO[152usize], entry), + 61usize => (&INFO[154usize], entry), + 62usize => (&INFO[157usize], entry), + 63usize => (&INFO[159usize], entry), _ => unsafe { core::hint::unreachable_unchecked() }, }) } @@ -1318,10 +1640,15 @@ impl Subscriber { 3usize => (&INFO[35usize], entry), 4usize => (&INFO[36usize], entry), 5usize => (&INFO[37usize], entry), - 6usize => (&INFO[58usize], entry), - 7usize => (&INFO[59usize], entry), - 8usize => (&INFO[112usize], entry), - 9usize => (&INFO[114usize], entry), + 6usize => (&INFO[51usize], entry), + 7usize => (&INFO[55usize], entry), + 8usize => (&INFO[59usize], entry), + 9usize => (&INFO[63usize], entry), + 10usize => (&INFO[87usize], entry), + 11usize => (&INFO[102usize], entry), + 12usize => (&INFO[103usize], entry), + 13usize => (&INFO[156usize], entry), + 14usize => (&INFO[158usize], entry), _ => unsafe { core::hint::unreachable_unchecked() }, }) } @@ -1370,133 +1697,133 @@ impl Subscriber { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[56usize], entries, variants) + (&INFO[100usize], entries, variants) } 5usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[57usize], entries, variants) + (&INFO[101usize], entries, variants) } 6usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[67usize], entries, variants) + (&INFO[111usize], entries, variants) } 7usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[69usize], entries, variants) + (&INFO[113usize], entries, variants) } 8usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[71usize], entries, variants) + (&INFO[115usize], entries, variants) } 9usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[73usize], entries, variants) + (&INFO[117usize], entries, variants) } 10usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[75usize], entries, variants) + (&INFO[119usize], entries, variants) } 11usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[77usize], entries, variants) + (&INFO[121usize], entries, variants) } 12usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[79usize], entries, variants) + (&INFO[123usize], entries, variants) } 13usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[81usize], entries, variants) + (&INFO[125usize], entries, variants) } 14usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[83usize], entries, variants) + (&INFO[127usize], entries, variants) } 15usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[91usize], entries, variants) + (&INFO[135usize], entries, variants) } 16usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[93usize], entries, variants) + (&INFO[137usize], entries, variants) } 17usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[95usize], entries, variants) + (&INFO[139usize], entries, variants) } 18usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[97usize], entries, variants) + (&INFO[141usize], entries, variants) } 19usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[99usize], entries, variants) + (&INFO[143usize], entries, variants) } 20usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[101usize], entries, variants) + (&INFO[145usize], entries, variants) } 21usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[103usize], entries, variants) + (&INFO[147usize], entries, variants) } 22usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[105usize], entries, variants) + (&INFO[149usize], entries, variants) } 23usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[107usize], entries, variants) + (&INFO[151usize], entries, variants) } 24usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[109usize], entries, variants) + (&INFO[153usize], entries, variants) } 25usize => { let offset = *entry; let variants = ::VARIANTS; let entries = &self.nominal_counters[offset..offset + variants.len()]; - (&INFO[111usize], entries, variants) + (&INFO[155usize], entries, variants) } _ => unsafe { core::hint::unreachable_unchecked() }, }) @@ -1532,23 +1859,48 @@ impl Subscriber { 13usize => (&INFO[50usize], entry), 14usize => (&INFO[52usize], entry), 15usize => (&INFO[54usize], entry), - 16usize => (&INFO[61usize], entry), - 17usize => (&INFO[63usize], entry), - 18usize => (&INFO[64usize], entry), - 19usize => (&INFO[65usize], entry), - 20usize => (&INFO[85usize], entry), - 21usize => (&INFO[86usize], entry), - 22usize => (&INFO[89usize], entry), - 23usize => (&INFO[116usize], entry), - 24usize => (&INFO[117usize], entry), - 25usize => (&INFO[118usize], entry), - 26usize => (&INFO[119usize], entry), - 27usize => (&INFO[120usize], entry), - 28usize => (&INFO[121usize], entry), - 29usize => (&INFO[122usize], entry), - 30usize => (&INFO[123usize], entry), - 31usize => (&INFO[124usize], entry), - 32usize => (&INFO[125usize], entry), + 16usize => (&INFO[56usize], entry), + 17usize => (&INFO[58usize], entry), + 18usize => (&INFO[60usize], entry), + 19usize => (&INFO[62usize], entry), + 20usize => (&INFO[65usize], entry), + 21usize => (&INFO[67usize], entry), + 22usize => (&INFO[68usize], entry), + 23usize => (&INFO[70usize], entry), + 24usize => (&INFO[71usize], entry), + 25usize => (&INFO[73usize], entry), + 26usize => (&INFO[74usize], entry), + 27usize => (&INFO[76usize], entry), + 28usize => (&INFO[78usize], entry), + 29usize => (&INFO[79usize], entry), + 30usize => (&INFO[81usize], entry), + 31usize => (&INFO[82usize], entry), + 32usize => (&INFO[84usize], entry), + 33usize => (&INFO[85usize], entry), + 34usize => (&INFO[89usize], entry), + 35usize => (&INFO[91usize], entry), + 36usize => (&INFO[92usize], entry), + 37usize => (&INFO[94usize], entry), + 38usize => (&INFO[95usize], entry), + 39usize => (&INFO[97usize], entry), + 40usize => (&INFO[98usize], entry), + 41usize => (&INFO[105usize], entry), + 42usize => (&INFO[107usize], entry), + 43usize => (&INFO[108usize], entry), + 44usize => (&INFO[109usize], entry), + 45usize => (&INFO[129usize], entry), + 46usize => (&INFO[130usize], entry), + 47usize => (&INFO[133usize], entry), + 48usize => (&INFO[160usize], entry), + 49usize => (&INFO[161usize], entry), + 50usize => (&INFO[162usize], entry), + 51usize => (&INFO[163usize], entry), + 52usize => (&INFO[164usize], entry), + 53usize => (&INFO[165usize], entry), + 54usize => (&INFO[166usize], entry), + 55usize => (&INFO[167usize], entry), + 56usize => (&INFO[168usize], entry), + 57usize => (&INFO[169usize], entry), _ => unsafe { core::hint::unreachable_unchecked() }, }) } @@ -1851,35 +2203,235 @@ impl event::Subscriber for Subscriber { let _ = meta; } #[inline] - fn on_application_write( + fn on_stream_write_flushed( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationWrite, + event: &api::StreamWriteFlushed, ) { #[allow(unused_imports)] use api::*; self.count(47usize, 18usize, 1usize); - self.measure(48usize, 12usize, event.total_len); - self.count(49usize, 19usize, event.write_len); - self.measure(50usize, 13usize, event.write_len); + self.measure(48usize, 12usize, event.provided_len); + self.count(49usize, 19usize, event.committed_len); + self.measure(50usize, 13usize, event.committed_len); + self.count_bool(51usize, 6usize, event.is_fin); + self.measure(52usize, 14usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_write_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteBlocked, + ) { + #[allow(unused_imports)] + use api::*; + self.count(53usize, 20usize, 1usize); + self.measure(54usize, 15usize, event.provided_len); + self.count_bool(55usize, 7usize, event.is_fin); + self.measure(56usize, 16usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_write_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteErrored, + ) { + #[allow(unused_imports)] + use api::*; + self.count(57usize, 21usize, 1usize); + self.measure(58usize, 17usize, event.provided_len); + self.count_bool(59usize, 8usize, event.is_fin); + self.measure(60usize, 18usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_write_shutdown( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteShutdown, + ) { + #[allow(unused_imports)] + use api::*; + self.count(61usize, 22usize, 1usize); + self.measure(62usize, 19usize, event.buffer_len); + self.count_bool(63usize, 9usize, event.background); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_write_socket_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketFlushed, + ) { + #[allow(unused_imports)] + use api::*; + self.count(64usize, 23usize, 1usize); + self.measure(65usize, 20usize, event.provided_len); + self.count(66usize, 24usize, event.committed_len); + self.measure(67usize, 21usize, event.committed_len); + self.measure(68usize, 22usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_write_socket_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketBlocked, + ) { + #[allow(unused_imports)] + use api::*; + self.count(69usize, 25usize, 1usize); + self.measure(70usize, 23usize, event.provided_len); + self.measure(71usize, 24usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_write_socket_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamWriteSocketErrored, + ) { + #[allow(unused_imports)] + use api::*; + self.count(72usize, 26usize, 1usize); + self.measure(73usize, 25usize, event.provided_len); + self.measure(74usize, 26usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_read_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadFlushed, + ) { + #[allow(unused_imports)] + use api::*; + self.count(75usize, 27usize, 1usize); + self.measure(76usize, 27usize, event.capacity); + self.count(77usize, 28usize, event.committed_len); + self.measure(78usize, 28usize, event.committed_len); + self.measure(79usize, 29usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_read_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadBlocked, + ) { + #[allow(unused_imports)] + use api::*; + self.count(80usize, 29usize, 1usize); + self.measure(81usize, 30usize, event.capacity); + self.measure(82usize, 31usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_read_errored( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadErrored, + ) { + #[allow(unused_imports)] + use api::*; + self.count(83usize, 30usize, 1usize); + self.measure(84usize, 32usize, event.capacity); + self.measure(85usize, 33usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_read_shutdown( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadShutdown, + ) { + #[allow(unused_imports)] + use api::*; + self.count(86usize, 31usize, 1usize); + self.count_bool(87usize, 10usize, event.background); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_read_socket_flushed( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadSocketFlushed, + ) { + #[allow(unused_imports)] + use api::*; + self.count(88usize, 32usize, 1usize); + self.measure(89usize, 34usize, event.capacity); + self.count(90usize, 33usize, event.committed_len); + self.measure(91usize, 35usize, event.committed_len); + self.measure(92usize, 36usize, event.processing_duration); + let _ = context; + let _ = meta; + let _ = event; + } + #[inline] + fn on_stream_read_socket_blocked( + &self, + context: &Self::ConnectionContext, + meta: &api::ConnectionMeta, + event: &api::StreamReadSocketBlocked, + ) { + #[allow(unused_imports)] + use api::*; + self.count(93usize, 34usize, 1usize); + self.measure(94usize, 37usize, event.capacity); + self.measure(95usize, 38usize, event.processing_duration); let _ = context; let _ = meta; let _ = event; } #[inline] - fn on_application_read( + fn on_stream_read_socket_errored( &self, context: &Self::ConnectionContext, meta: &api::ConnectionMeta, - event: &api::ApplicationRead, + event: &api::StreamReadSocketErrored, ) { #[allow(unused_imports)] use api::*; - self.count(51usize, 20usize, 1usize); - self.measure(52usize, 14usize, event.capacity); - self.count(53usize, 21usize, event.read_len); - self.measure(54usize, 15usize, event.read_len); + self.count(96usize, 35usize, 1usize); + self.measure(97usize, 39usize, event.capacity); + self.measure(98usize, 40usize, event.processing_duration); let _ = context; let _ = meta; let _ = event; @@ -1888,11 +2440,11 @@ impl event::Subscriber for Subscriber { fn on_endpoint_initialized(&self, meta: &api::EndpointMeta, event: &api::EndpointInitialized) { #[allow(unused_imports)] use api::*; - self.count(55usize, 22usize, 1usize); - self.count_nominal(56usize, 4usize, &event.acceptor_addr); - self.count_nominal(57usize, 5usize, &event.handshake_addr); - self.count_bool(58usize, 6usize, event.tcp); - self.count_bool(59usize, 7usize, event.udp); + self.count(99usize, 36usize, 1usize); + self.count_nominal(100usize, 4usize, &event.acceptor_addr); + self.count_nominal(101usize, 5usize, &event.handshake_addr); + self.count_bool(102usize, 11usize, event.tcp); + self.count_bool(103usize, 12usize, event.udp); let _ = event; let _ = meta; } @@ -1904,8 +2456,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(60usize, 23usize, 1usize); - self.measure(61usize, 16usize, event.capacity); + self.count(104usize, 37usize, 1usize); + self.measure(105usize, 41usize, event.capacity); let _ = event; let _ = meta; } @@ -1917,10 +2469,10 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(62usize, 24usize, 1usize); - self.measure(63usize, 17usize, event.capacity); - self.measure(64usize, 18usize, event.entries); - self.measure(65usize, 19usize, event.lifetime); + self.count(106usize, 38usize, 1usize); + self.measure(107usize, 42usize, event.capacity); + self.measure(108usize, 43usize, event.entries); + self.measure(109usize, 44usize, event.lifetime); let _ = event; let _ = meta; } @@ -1932,8 +2484,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(66usize, 25usize, 1usize); - self.count_nominal(67usize, 6usize, &event.peer_address); + self.count(110usize, 39usize, 1usize); + self.count_nominal(111usize, 6usize, &event.peer_address); let _ = event; let _ = meta; } @@ -1945,8 +2497,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(68usize, 26usize, 1usize); - self.count_nominal(69usize, 7usize, &event.peer_address); + self.count(112usize, 40usize, 1usize); + self.count_nominal(113usize, 7usize, &event.peer_address); let _ = event; let _ = meta; } @@ -1958,8 +2510,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(70usize, 27usize, 1usize); - self.count_nominal(71usize, 8usize, &event.peer_address); + self.count(114usize, 41usize, 1usize); + self.count_nominal(115usize, 8usize, &event.peer_address); let _ = event; let _ = meta; } @@ -1971,8 +2523,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(72usize, 28usize, 1usize); - self.count_nominal(73usize, 9usize, &event.peer_address); + self.count(116usize, 42usize, 1usize); + self.count_nominal(117usize, 9usize, &event.peer_address); let _ = event; let _ = meta; } @@ -1984,8 +2536,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(74usize, 29usize, 1usize); - self.count_nominal(75usize, 10usize, &event.peer_address); + self.count(118usize, 43usize, 1usize); + self.count_nominal(119usize, 10usize, &event.peer_address); let _ = event; let _ = meta; } @@ -1997,8 +2549,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(76usize, 30usize, 1usize); - self.count_nominal(77usize, 11usize, &event.peer_address); + self.count(120usize, 44usize, 1usize); + self.count_nominal(121usize, 11usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2010,8 +2562,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(78usize, 31usize, 1usize); - self.count_nominal(79usize, 12usize, &event.peer_address); + self.count(122usize, 45usize, 1usize); + self.count_nominal(123usize, 12usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2023,8 +2575,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(80usize, 32usize, 1usize); - self.count_nominal(81usize, 13usize, &event.peer_address); + self.count(124usize, 46usize, 1usize); + self.count_nominal(125usize, 13usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2036,8 +2588,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(82usize, 33usize, 1usize); - self.count_nominal(83usize, 14usize, &event.peer_address); + self.count(126usize, 47usize, 1usize); + self.count_nominal(127usize, 14usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2045,9 +2597,9 @@ impl event::Subscriber for Subscriber { fn on_key_accepted(&self, meta: &api::EndpointMeta, event: &api::KeyAccepted) { #[allow(unused_imports)] use api::*; - self.count(84usize, 34usize, 1usize); - self.measure(85usize, 20usize, event.gap); - self.measure(86usize, 21usize, event.forward_shift); + self.count(128usize, 48usize, 1usize); + self.measure(129usize, 45usize, event.gap); + self.measure(130usize, 46usize, event.forward_shift); let _ = event; let _ = meta; } @@ -2059,7 +2611,7 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(87usize, 35usize, 1usize); + self.count(131usize, 49usize, 1usize); let _ = event; let _ = meta; } @@ -2071,8 +2623,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(88usize, 36usize, 1usize); - self.measure(89usize, 22usize, event.gap); + self.count(132usize, 50usize, 1usize); + self.measure(133usize, 47usize, event.gap); let _ = event; let _ = meta; } @@ -2084,8 +2636,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(90usize, 37usize, 1usize); - self.count_nominal(91usize, 15usize, &event.peer_address); + self.count(134usize, 51usize, 1usize); + self.count_nominal(135usize, 15usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2097,8 +2649,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(92usize, 38usize, 1usize); - self.count_nominal(93usize, 16usize, &event.peer_address); + self.count(136usize, 52usize, 1usize); + self.count_nominal(137usize, 16usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2110,8 +2662,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(94usize, 39usize, 1usize); - self.count_nominal(95usize, 17usize, &event.peer_address); + self.count(138usize, 53usize, 1usize); + self.count_nominal(139usize, 17usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2123,8 +2675,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(96usize, 40usize, 1usize); - self.count_nominal(97usize, 18usize, &event.peer_address); + self.count(140usize, 54usize, 1usize); + self.count_nominal(141usize, 18usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2136,8 +2688,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(98usize, 41usize, 1usize); - self.count_nominal(99usize, 19usize, &event.peer_address); + self.count(142usize, 55usize, 1usize); + self.count_nominal(143usize, 19usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2145,8 +2697,8 @@ impl event::Subscriber for Subscriber { fn on_stale_key_packet_sent(&self, meta: &api::EndpointMeta, event: &api::StaleKeyPacketSent) { #[allow(unused_imports)] use api::*; - self.count(100usize, 42usize, 1usize); - self.count_nominal(101usize, 20usize, &event.peer_address); + self.count(144usize, 56usize, 1usize); + self.count_nominal(145usize, 20usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2158,8 +2710,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(102usize, 43usize, 1usize); - self.count_nominal(103usize, 21usize, &event.peer_address); + self.count(146usize, 57usize, 1usize); + self.count_nominal(147usize, 21usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2171,8 +2723,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(104usize, 44usize, 1usize); - self.count_nominal(105usize, 22usize, &event.peer_address); + self.count(148usize, 58usize, 1usize); + self.count_nominal(149usize, 22usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2184,8 +2736,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(106usize, 45usize, 1usize); - self.count_nominal(107usize, 23usize, &event.peer_address); + self.count(150usize, 59usize, 1usize); + self.count_nominal(151usize, 23usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2197,8 +2749,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(108usize, 46usize, 1usize); - self.count_nominal(109usize, 24usize, &event.peer_address); + self.count(152usize, 60usize, 1usize); + self.count_nominal(153usize, 24usize, &event.peer_address); let _ = event; let _ = meta; } @@ -2210,9 +2762,9 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(110usize, 47usize, 1usize); - self.count_nominal(111usize, 25usize, &event.peer_address); - self.count_bool(112usize, 8usize, event.hit); + self.count(154usize, 61usize, 1usize); + self.count_nominal(155usize, 25usize, &event.peer_address); + self.count_bool(156usize, 13usize, event.hit); let _ = event; let _ = meta; } @@ -2224,8 +2776,8 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(113usize, 48usize, 1usize); - self.count_bool(114usize, 9usize, event.hit); + self.count(157usize, 62usize, 1usize); + self.count_bool(158usize, 14usize, event.hit); let _ = event; let _ = meta; } @@ -2237,17 +2789,17 @@ impl event::Subscriber for Subscriber { ) { #[allow(unused_imports)] use api::*; - self.count(115usize, 49usize, 1usize); - self.measure(116usize, 23usize, event.id_entries); - self.measure(117usize, 24usize, event.id_entries_retired); - self.measure(118usize, 25usize, event.id_entries_utilization); - self.measure(119usize, 26usize, event.id_entries_initial_utilization); - self.measure(120usize, 27usize, event.address_entries); - self.measure(121usize, 28usize, event.address_entries_retired); - self.measure(122usize, 29usize, event.address_entries_utilization); - self.measure(123usize, 30usize, event.address_entries_initial_utilization); - self.measure(124usize, 31usize, event.handshake_requests); - self.measure(125usize, 32usize, event.handshake_requests_retired); + self.count(159usize, 63usize, 1usize); + self.measure(160usize, 48usize, event.id_entries); + self.measure(161usize, 49usize, event.id_entries_retired); + self.measure(162usize, 50usize, event.id_entries_utilization); + self.measure(163usize, 51usize, event.id_entries_initial_utilization); + self.measure(164usize, 52usize, event.address_entries); + self.measure(165usize, 53usize, event.address_entries_retired); + self.measure(166usize, 54usize, event.address_entries_utilization); + self.measure(167usize, 55usize, event.address_entries_initial_utilization); + self.measure(168usize, 56usize, event.handshake_requests); + self.measure(169usize, 57usize, event.handshake_requests_retired); let _ = event; let _ = meta; } diff --git a/dc/s2n-quic-dc/src/event/generated/metrics/probe.rs b/dc/s2n-quic-dc/src/event/generated/metrics/probe.rs index 74c1c460b..2c1165bd0 100644 --- a/dc/s2n-quic-dc/src/event/generated/metrics/probe.rs +++ b/dc/s2n-quic-dc/src/event/generated/metrics/probe.rs @@ -35,38 +35,52 @@ mod counter { 41usize => Self(acceptor_udp_io_error), 42usize => Self(acceptor_stream_pruned), 45usize => Self(acceptor_stream_dequeued), - 47usize => Self(application_write), - 49usize => Self(application_write__committed__total), - 51usize => Self(application_read), - 53usize => Self(application_read__committed__total), - 55usize => Self(endpoint_initialized), - 60usize => Self(path_secret_map_initialized), - 62usize => Self(path_secret_map_uninitialized), - 66usize => Self(path_secret_map_background_handshake_requested), - 68usize => Self(path_secret_map_entry_inserted), - 70usize => Self(path_secret_map_entry_ready), - 72usize => Self(path_secret_map_entry_replaced), - 74usize => Self(unknown_path_secret_packet_sent), - 76usize => Self(unknown_path_secret_packet_received), - 78usize => Self(unknown_path_secret_packet_accepted), - 80usize => Self(unknown_path_secret_packet_rejected), - 82usize => Self(unknown_path_secret_packet_dropped), - 84usize => Self(key_accepted), - 87usize => Self(replay_definitely_detected), - 88usize => Self(replay_potentially_detected), - 90usize => Self(replay_detected_packet_sent), - 92usize => Self(replay_detected_packet_received), - 94usize => Self(replay_detected_packet_accepted), - 96usize => Self(replay_detected_packet_rejected), - 98usize => Self(replay_detected_packet_dropped), - 100usize => Self(stale_key_packet_sent), - 102usize => Self(stale_key_packet_received), - 104usize => Self(stale_key_packet_accepted), - 106usize => Self(stale_key_packet_rejected), - 108usize => Self(stale_key_packet_dropped), - 110usize => Self(path_secret_map_address_cache_accessed), - 113usize => Self(path_secret_map_id_cache_accessed), - 115usize => Self(path_secret_map_cleaner_cycled), + 47usize => Self(stream_write_flushed), + 49usize => Self(stream_write_flushed__committed__total), + 53usize => Self(stream_write_blocked), + 57usize => Self(stream_write_errored), + 61usize => Self(stream_write_shutdown), + 64usize => Self(stream_write_socket_flushed), + 66usize => Self(stream_write_socket_flushed__committed__total), + 69usize => Self(stream_write_socket_blocked), + 72usize => Self(stream_write_socket_errored), + 75usize => Self(stream_read_flushed), + 77usize => Self(stream_read_flushed__committed__total), + 80usize => Self(stream_read_blocked), + 83usize => Self(stream_read_errored), + 86usize => Self(stream_read_shutdown), + 88usize => Self(stream_read_socket_flushed), + 90usize => Self(stream_read_socket_flushed__committed__total), + 93usize => Self(stream_read_socket_blocked), + 96usize => Self(stream_read_socket_errored), + 99usize => Self(endpoint_initialized), + 104usize => Self(path_secret_map_initialized), + 106usize => Self(path_secret_map_uninitialized), + 110usize => Self(path_secret_map_background_handshake_requested), + 112usize => Self(path_secret_map_entry_inserted), + 114usize => Self(path_secret_map_entry_ready), + 116usize => Self(path_secret_map_entry_replaced), + 118usize => Self(unknown_path_secret_packet_sent), + 120usize => Self(unknown_path_secret_packet_received), + 122usize => Self(unknown_path_secret_packet_accepted), + 124usize => Self(unknown_path_secret_packet_rejected), + 126usize => Self(unknown_path_secret_packet_dropped), + 128usize => Self(key_accepted), + 131usize => Self(replay_definitely_detected), + 132usize => Self(replay_potentially_detected), + 134usize => Self(replay_detected_packet_sent), + 136usize => Self(replay_detected_packet_received), + 138usize => Self(replay_detected_packet_accepted), + 140usize => Self(replay_detected_packet_rejected), + 142usize => Self(replay_detected_packet_dropped), + 144usize => Self(stale_key_packet_sent), + 146usize => Self(stale_key_packet_received), + 148usize => Self(stale_key_packet_accepted), + 150usize => Self(stale_key_packet_rejected), + 152usize => Self(stale_key_packet_dropped), + 154usize => Self(path_secret_map_address_cache_accessed), + 157usize => Self(path_secret_map_id_cache_accessed), + 159usize => Self(path_secret_map_cleaner_cycled), _ => unreachable!("invalid info: {info:?}"), } } @@ -114,14 +128,42 @@ mod counter { fn acceptor_stream_pruned(value: u64); # [link_name = s2n_quic_dc__event__counter__acceptor_stream_dequeued] fn acceptor_stream_dequeued(value: u64); - # [link_name = s2n_quic_dc__event__counter__application_write] - fn application_write(value: u64); - # [link_name = s2n_quic_dc__event__counter__application_write__committed__total] - fn application_write__committed__total(value: u64); - # [link_name = s2n_quic_dc__event__counter__application_read] - fn application_read(value: u64); - # [link_name = s2n_quic_dc__event__counter__application_read__committed__total] - fn application_read__committed__total(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_write_flushed] + fn stream_write_flushed(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_write_flushed__committed__total] + fn stream_write_flushed__committed__total(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_write_blocked] + fn stream_write_blocked(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_write_errored] + fn stream_write_errored(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_write_shutdown] + fn stream_write_shutdown(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_write_socket_flushed] + fn stream_write_socket_flushed(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_write_socket_flushed__committed__total] + fn stream_write_socket_flushed__committed__total(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_write_socket_blocked] + fn stream_write_socket_blocked(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_write_socket_errored] + fn stream_write_socket_errored(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_read_flushed] + fn stream_read_flushed(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_read_flushed__committed__total] + fn stream_read_flushed__committed__total(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_read_blocked] + fn stream_read_blocked(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_read_errored] + fn stream_read_errored(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_read_shutdown] + fn stream_read_shutdown(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_read_socket_flushed] + fn stream_read_socket_flushed(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_read_socket_flushed__committed__total] + fn stream_read_socket_flushed__committed__total(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_read_socket_blocked] + fn stream_read_socket_blocked(value: u64); + # [link_name = s2n_quic_dc__event__counter__stream_read_socket_errored] + fn stream_read_socket_errored(value: u64); # [link_name = s2n_quic_dc__event__counter__endpoint_initialized] fn endpoint_initialized(value: u64); # [link_name = s2n_quic_dc__event__counter__path_secret_map_initialized] @@ -193,10 +235,15 @@ mod counter { 35usize => Self(acceptor_udp_packet_received__is_retransmisson), 36usize => Self(acceptor_udp_packet_received__is_fin), 37usize => Self(acceptor_udp_packet_received__is_fin_known), - 58usize => Self(endpoint_initialized__tcp), - 59usize => Self(endpoint_initialized__udp), - 112usize => Self(path_secret_map_address_cache_accessed__hit), - 114usize => Self(path_secret_map_id_cache_accessed__hit), + 51usize => Self(stream_write_flushed__is_fin), + 55usize => Self(stream_write_blocked__is_fin), + 59usize => Self(stream_write_errored__is_fin), + 63usize => Self(stream_write_shutdown__background), + 87usize => Self(stream_read_shutdown__background), + 102usize => Self(endpoint_initialized__tcp), + 103usize => Self(endpoint_initialized__udp), + 156usize => Self(path_secret_map_address_cache_accessed__hit), + 158usize => Self(path_secret_map_id_cache_accessed__hit), _ => unreachable!("invalid info: {info:?}"), } } @@ -220,6 +267,16 @@ mod counter { fn acceptor_udp_packet_received__is_fin(value: bool); # [link_name = s2n_quic_dc__event__counter__bool__acceptor_udp_packet_received__is_fin_known] fn acceptor_udp_packet_received__is_fin_known(value: bool); + # [link_name = s2n_quic_dc__event__counter__bool__stream_write_flushed__is_fin] + fn stream_write_flushed__is_fin(value: bool); + # [link_name = s2n_quic_dc__event__counter__bool__stream_write_blocked__is_fin] + fn stream_write_blocked__is_fin(value: bool); + # [link_name = s2n_quic_dc__event__counter__bool__stream_write_errored__is_fin] + fn stream_write_errored__is_fin(value: bool); + # [link_name = s2n_quic_dc__event__counter__bool__stream_write_shutdown__background] + fn stream_write_shutdown__background(value: bool); + # [link_name = s2n_quic_dc__event__counter__bool__stream_read_shutdown__background] + fn stream_read_shutdown__background(value: bool); # [link_name = s2n_quic_dc__event__counter__bool__endpoint_initialized__tcp] fn endpoint_initialized__tcp(value: bool); # [link_name = s2n_quic_dc__event__counter__bool__endpoint_initialized__udp] @@ -243,30 +300,30 @@ mod counter { 23usize => Self(acceptor_tcp_packet_dropped__reason), 39usize => Self(acceptor_udp_packet_dropped__reason), 44usize => Self(acceptor_stream_pruned__reason), - 56usize => Self(endpoint_initialized__acceptor__protocol), - 57usize => Self(endpoint_initialized__handshake__protocol), - 67usize => { + 100usize => Self(endpoint_initialized__acceptor__protocol), + 101usize => Self(endpoint_initialized__handshake__protocol), + 111usize => { Self(path_secret_map_background_handshake_requested__peer_address__protocol) } - 69usize => Self(path_secret_map_entry_inserted__peer_address__protocol), - 71usize => Self(path_secret_map_entry_ready__peer_address__protocol), - 73usize => Self(path_secret_map_entry_replaced__peer_address__protocol), - 75usize => Self(unknown_path_secret_packet_sent__peer_address__protocol), - 77usize => Self(unknown_path_secret_packet_received__peer_address__protocol), - 79usize => Self(unknown_path_secret_packet_accepted__peer_address__protocol), - 81usize => Self(unknown_path_secret_packet_rejected__peer_address__protocol), - 83usize => Self(unknown_path_secret_packet_dropped__peer_address__protocol), - 91usize => Self(replay_detected_packet_sent__peer_address__protocol), - 93usize => Self(replay_detected_packet_received__peer_address__protocol), - 95usize => Self(replay_detected_packet_accepted__peer_address__protocol), - 97usize => Self(replay_detected_packet_rejected__peer_address__protocol), - 99usize => Self(replay_detected_packet_dropped__peer_address__protocol), - 101usize => Self(stale_key_packet_sent__peer_address__protocol), - 103usize => Self(stale_key_packet_received__peer_address__protocol), - 105usize => Self(stale_key_packet_accepted__peer_address__protocol), - 107usize => Self(stale_key_packet_rejected__peer_address__protocol), - 109usize => Self(stale_key_packet_dropped__peer_address__protocol), - 111usize => { + 113usize => Self(path_secret_map_entry_inserted__peer_address__protocol), + 115usize => Self(path_secret_map_entry_ready__peer_address__protocol), + 117usize => Self(path_secret_map_entry_replaced__peer_address__protocol), + 119usize => Self(unknown_path_secret_packet_sent__peer_address__protocol), + 121usize => Self(unknown_path_secret_packet_received__peer_address__protocol), + 123usize => Self(unknown_path_secret_packet_accepted__peer_address__protocol), + 125usize => Self(unknown_path_secret_packet_rejected__peer_address__protocol), + 127usize => Self(unknown_path_secret_packet_dropped__peer_address__protocol), + 135usize => Self(replay_detected_packet_sent__peer_address__protocol), + 137usize => Self(replay_detected_packet_received__peer_address__protocol), + 139usize => Self(replay_detected_packet_accepted__peer_address__protocol), + 141usize => Self(replay_detected_packet_rejected__peer_address__protocol), + 143usize => Self(replay_detected_packet_dropped__peer_address__protocol), + 145usize => Self(stale_key_packet_sent__peer_address__protocol), + 147usize => Self(stale_key_packet_received__peer_address__protocol), + 149usize => Self(stale_key_packet_accepted__peer_address__protocol), + 151usize => Self(stale_key_packet_rejected__peer_address__protocol), + 153usize => Self(stale_key_packet_dropped__peer_address__protocol), + 155usize => { Self(path_secret_map_address_cache_accessed__peer_address__protocol) } _ => unreachable!("invalid info: {info:?}"), @@ -465,29 +522,54 @@ mod measure { 27usize => Self(acceptor_tcp_stream_enqueued__blocked_count), 31usize => Self(acceptor_udp_datagram_received__len), 33usize => Self(acceptor_udp_packet_received__payload_len), - 48usize => Self(application_write__provided), - 50usize => Self(application_write__committed), - 52usize => Self(application_read__capacity), - 54usize => Self(application_read__committed), - 61usize => Self(path_secret_map_initialized__capacity), - 63usize => Self(path_secret_map_uninitialized__capacity), - 64usize => Self(path_secret_map_uninitialized__entries), - 65usize => Self(path_secret_map_uninitialized__lifetime), - 85usize => Self(key_accepted__gap), - 86usize => Self(key_accepted__forward_shift), - 89usize => Self(replay_potentially_detected__gap), - 116usize => Self(path_secret_map_cleaner_cycled__entries__id), - 117usize => Self(path_secret_map_cleaner_cycled__entries__id__retired), - 118usize => Self(path_secret_map_cleaner_cycled__entries__id__utilization), - 119usize => Self(path_secret_map_cleaner_cycled__entries__id__utilization__initial), - 120usize => Self(path_secret_map_cleaner_cycled__entries__address), - 121usize => Self(path_secret_map_cleaner_cycled__entries__address__retired), - 122usize => Self(path_secret_map_cleaner_cycled__entries__address__utilization), - 123usize => { + 48usize => Self(stream_write_flushed__provided), + 50usize => Self(stream_write_flushed__committed), + 52usize => Self(stream_write_flushed__processing_duration), + 54usize => Self(stream_write_blocked__provided), + 56usize => Self(stream_write_blocked__processing_duration), + 58usize => Self(stream_write_errored__provided), + 60usize => Self(stream_write_errored__processing_duration), + 62usize => Self(stream_write_shutdown__buffer_len), + 65usize => Self(stream_write_socket_flushed__provided), + 67usize => Self(stream_write_socket_flushed__committed), + 68usize => Self(stream_write_socket_flushed__processing_duration), + 70usize => Self(stream_write_socket_blocked__provided), + 71usize => Self(stream_write_socket_blocked__processing_duration), + 73usize => Self(stream_write_socket_errored__provided), + 74usize => Self(stream_write_socket_errored__processing_duration), + 76usize => Self(stream_read_flushed__capacity), + 78usize => Self(stream_read_flushed__committed), + 79usize => Self(stream_read_flushed__processing_duration), + 81usize => Self(stream_read_blocked__capacity), + 82usize => Self(stream_read_blocked__processing_duration), + 84usize => Self(stream_read_errored__capacity), + 85usize => Self(stream_read_errored__processing_duration), + 89usize => Self(stream_read_socket_flushed__capacity), + 91usize => Self(stream_read_socket_flushed__committed), + 92usize => Self(stream_read_socket_flushed__processing_duration), + 94usize => Self(stream_read_socket_blocked__capacity), + 95usize => Self(stream_read_socket_blocked__processing_duration), + 97usize => Self(stream_read_socket_errored__capacity), + 98usize => Self(stream_read_socket_errored__processing_duration), + 105usize => Self(path_secret_map_initialized__capacity), + 107usize => Self(path_secret_map_uninitialized__capacity), + 108usize => Self(path_secret_map_uninitialized__entries), + 109usize => Self(path_secret_map_uninitialized__lifetime), + 129usize => Self(key_accepted__gap), + 130usize => Self(key_accepted__forward_shift), + 133usize => Self(replay_potentially_detected__gap), + 160usize => Self(path_secret_map_cleaner_cycled__entries__id), + 161usize => Self(path_secret_map_cleaner_cycled__entries__id__retired), + 162usize => Self(path_secret_map_cleaner_cycled__entries__id__utilization), + 163usize => Self(path_secret_map_cleaner_cycled__entries__id__utilization__initial), + 164usize => Self(path_secret_map_cleaner_cycled__entries__address), + 165usize => Self(path_secret_map_cleaner_cycled__entries__address__retired), + 166usize => Self(path_secret_map_cleaner_cycled__entries__address__utilization), + 167usize => { Self(path_secret_map_cleaner_cycled__entries__address__utilization__initial) } - 124usize => Self(path_secret_map_cleaner_cycled__handshake_requests), - 125usize => Self(path_secret_map_cleaner_cycled__handshake_requests__retired), + 168usize => Self(path_secret_map_cleaner_cycled__handshake_requests), + 169usize => Self(path_secret_map_cleaner_cycled__handshake_requests__retired), _ => unreachable!("invalid info: {info:?}"), } } @@ -523,14 +605,64 @@ mod measure { fn acceptor_udp_datagram_received__len(value: u64); # [link_name = s2n_quic_dc__event__measure__acceptor_udp_packet_received__payload_len] fn acceptor_udp_packet_received__payload_len(value: u64); - # [link_name = s2n_quic_dc__event__measure__application_write__provided] - fn application_write__provided(value: u64); - # [link_name = s2n_quic_dc__event__measure__application_write__committed] - fn application_write__committed(value: u64); - # [link_name = s2n_quic_dc__event__measure__application_read__capacity] - fn application_read__capacity(value: u64); - # [link_name = s2n_quic_dc__event__measure__application_read__committed] - fn application_read__committed(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_flushed__provided] + fn stream_write_flushed__provided(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_flushed__committed] + fn stream_write_flushed__committed(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_flushed__processing_duration] + fn stream_write_flushed__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_blocked__provided] + fn stream_write_blocked__provided(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_blocked__processing_duration] + fn stream_write_blocked__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_errored__provided] + fn stream_write_errored__provided(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_errored__processing_duration] + fn stream_write_errored__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_shutdown__buffer_len] + fn stream_write_shutdown__buffer_len(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_socket_flushed__provided] + fn stream_write_socket_flushed__provided(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_socket_flushed__committed] + fn stream_write_socket_flushed__committed(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_socket_flushed__processing_duration] + fn stream_write_socket_flushed__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_socket_blocked__provided] + fn stream_write_socket_blocked__provided(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_socket_blocked__processing_duration] + fn stream_write_socket_blocked__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_socket_errored__provided] + fn stream_write_socket_errored__provided(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_write_socket_errored__processing_duration] + fn stream_write_socket_errored__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_flushed__capacity] + fn stream_read_flushed__capacity(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_flushed__committed] + fn stream_read_flushed__committed(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_flushed__processing_duration] + fn stream_read_flushed__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_blocked__capacity] + fn stream_read_blocked__capacity(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_blocked__processing_duration] + fn stream_read_blocked__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_errored__capacity] + fn stream_read_errored__capacity(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_errored__processing_duration] + fn stream_read_errored__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_socket_flushed__capacity] + fn stream_read_socket_flushed__capacity(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_socket_flushed__committed] + fn stream_read_socket_flushed__committed(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_socket_flushed__processing_duration] + fn stream_read_socket_flushed__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_socket_blocked__capacity] + fn stream_read_socket_blocked__capacity(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_socket_blocked__processing_duration] + fn stream_read_socket_blocked__processing_duration(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_socket_errored__capacity] + fn stream_read_socket_errored__capacity(value: u64); + # [link_name = s2n_quic_dc__event__measure__stream_read_socket_errored__processing_duration] + fn stream_read_socket_errored__processing_duration(value: u64); # [link_name = s2n_quic_dc__event__measure__path_secret_map_initialized__capacity] fn path_secret_map_initialized__capacity(value: u64); # [link_name = s2n_quic_dc__event__measure__path_secret_map_uninitialized__capacity] diff --git a/dc/s2n-quic-dc/src/stream/endpoint.rs b/dc/s2n-quic-dc/src/stream/endpoint.rs index 9d0adfafc..3554bde50 100644 --- a/dc/s2n-quic-dc/src/stream/endpoint.rs +++ b/dc/s2n-quic-dc/src/stream/endpoint.rs @@ -247,8 +247,10 @@ where last_peer_activity: Default::default(), fixed, closed_halves: 0u8.into(), - subscriber, - subscriber_ctx, + subscriber: shared::Subscriber { + subscriber, + context: subscriber_ctx, + }, } }; diff --git a/dc/s2n-quic-dc/src/stream/recv/application.rs b/dc/s2n-quic-dc/src/stream/recv/application.rs index 8dff47381..0680f65cc 100644 --- a/dc/s2n-quic-dc/src/stream/recv/application.rs +++ b/dc/s2n-quic-dc/src/stream/recv/application.rs @@ -3,7 +3,8 @@ use crate::{ clock::Timer, - event, msg, + event::{self, ConnectionPublisher as _}, + msg, stream::{recv, runtime, shared::ArcShared, socket}, }; use core::{ @@ -17,7 +18,7 @@ use s2n_quic_core::{ ensure, ready, stream::state, task::waker, - time::{clock::Timer as _, timer::Provider as _}, + time::{clock::Timer as _, timer::Provider as _, Timestamp}, }; use std::{io, net::SocketAddr}; @@ -143,7 +144,10 @@ where where S: buffer::writer::Storage, { - waker::debug_assert_contract(cx, |cx| { + let start_time = self.0.shared.clock.get_time(); + let capacity = out_buf.remaining_capacity(); + + let result = waker::debug_assert_contract(cx, |cx| { let mut out_buf = out_buf.track_write(); let res = self.0.poll_read_into(cx, &mut out_buf); @@ -161,7 +165,11 @@ where res?; Ok(out_buf.written_len()).into() - }) + }); + + self.0.publish_read_events(capacity, start_time, &result); + + result } } @@ -249,7 +257,12 @@ where let before_len = reader.recv_buffer.payload_len(); - let recv = reader.poll_fill_recv_buffer(cx, self.sockets.read_application()); + let recv = reader.poll_fill_recv_buffer( + cx, + self.sockets.read_application(), + &self.shared.clock, + &self.shared.subscriber, + ); match Self::handle_socket_result(cx, &mut reader.receiver, &mut self.timer, recv) { Poll::Ready(res) => res?, @@ -308,10 +321,24 @@ where #[inline] fn shutdown(mut self: Box) { + // If the application never read from the stream try to do so now + if let LocalState::Ready = self.local_state { + let mut storage = buffer::writer::storage::Empty; + let waker = s2n_quic_core::task::waker::noop(); + let mut cx = core::task::Context::from_waker(&waker); + let _ = self.poll_read_into(&mut cx, &mut storage.track_write()); + } + + let background = matches!(self.local_state, LocalState::Ready); + + self.shared + .publisher() + .on_stream_read_shutdown(event::builder::StreamReadShutdown { background }); + // If we haven't exited the `Ready` state then spawn a task to do it for the application // // This is important for processing any secret control packets that the server sends us - if let LocalState::Ready = self.local_state { + if background { tracing::debug!("spawning task to read server's response"); let runtime = self.runtime.clone(); let handle = Shutdown(self); @@ -328,6 +355,47 @@ where self.shared.receiver.shutdown(is_panicking); } + + #[inline(always)] + fn publish_read_events( + &self, + capacity: usize, + start_time: Timestamp, + result: &Poll>, + ) { + let end_time = self.shared.clock.get_time(); + let processing_duration = end_time.saturating_duration_since(start_time); + + match result { + Poll::Ready(Ok(len)) => { + self.shared.common.publisher().on_stream_read_flushed( + event::builder::StreamReadFlushed { + capacity, + committed_len: *len, + processing_duration, + }, + ); + } + Poll::Ready(Err(error)) => { + let errno = error.raw_os_error(); + self.shared.common.publisher().on_stream_read_errored( + event::builder::StreamReadErrored { + capacity, + processing_duration, + errno, + }, + ); + } + Poll::Pending => { + self.shared.common.publisher().on_stream_read_blocked( + event::builder::StreamReadBlocked { + capacity, + processing_duration, + }, + ); + } + }; + } } #[cfg(feature = "tokio")] diff --git a/dc/s2n-quic-dc/src/stream/recv/shared.rs b/dc/s2n-quic-dc/src/stream/recv/shared.rs index 3e58f8b90..7812047dc 100644 --- a/dc/s2n-quic-dc/src/stream/recv/shared.rs +++ b/dc/s2n-quic-dc/src/stream/recv/shared.rs @@ -3,12 +3,14 @@ use crate::{ allocator::Allocator, - clock, event, msg, + clock, + event::{self, ConnectionPublisher}, + msg, packet::{stream, Packet}, stream::{ recv, server::handshake, - shared::{ArcShared, Half}, + shared::{self, ArcShared, Half}, socket::{self, Socket}, TransportFeatures, }, @@ -311,9 +313,17 @@ impl Inner { } #[inline] - pub fn poll_fill_recv_buffer(&mut self, cx: &mut Context, socket: &S) -> Poll> + pub fn poll_fill_recv_buffer( + &mut self, + cx: &mut Context, + socket: &S, + clock: &C, + subscriber: &shared::Subscriber, + ) -> Poll> where S: ?Sized + Socket, + C: ?Sized + Clock, + Sub: event::Subscriber, { loop { if let Some(chan) = self.handshake.as_mut() { @@ -336,12 +346,66 @@ impl Inner { } } - ready!(socket.poll_recv_buffer(cx, &mut self.recv_buffer))?; + ready!(self.poll_fill_recv_buffer_once(cx, socket, clock, subscriber))?; return Ok(()).into(); } } + #[inline(always)] + fn poll_fill_recv_buffer_once( + &mut self, + cx: &mut Context, + socket: &S, + clock: &C, + subscriber: &shared::Subscriber, + ) -> Poll> + where + S: ?Sized + Socket, + C: ?Sized + Clock, + Sub: event::Subscriber, + { + let capacity = self.recv_buffer.remaining_capacity(); + let start_time = clock.get_time(); + + let result = socket.poll_recv_buffer(cx, &mut self.recv_buffer); + + let now = clock.get_time(); + let processing_duration = now.saturating_duration_since(start_time); + + match &result { + Poll::Ready(Ok(len)) => { + subscriber.publisher(now).on_stream_read_socket_flushed( + event::builder::StreamReadSocketFlushed { + capacity, + committed_len: *len, + processing_duration, + }, + ); + } + Poll::Ready(Err(error)) => { + let errno = error.raw_os_error(); + subscriber.publisher(now).on_stream_read_socket_errored( + event::builder::StreamReadSocketErrored { + capacity, + processing_duration, + errno, + }, + ); + } + Poll::Pending => { + subscriber.publisher(now).on_stream_read_socket_blocked( + event::builder::StreamReadSocketBlocked { + capacity, + processing_duration, + }, + ); + } + }; + + result + } + #[inline] pub fn process_recv_buffer( &mut self, diff --git a/dc/s2n-quic-dc/src/stream/recv/worker.rs b/dc/s2n-quic-dc/src/stream/recv/worker.rs index 151fde67f..db4dbf024 100644 --- a/dc/s2n-quic-dc/src/stream/recv/worker.rs +++ b/dc/s2n-quic-dc/src/stream/recv/worker.rs @@ -304,7 +304,12 @@ where ); } - let res = recv.poll_fill_recv_buffer(cx, &self.socket); + let res = recv.poll_fill_recv_buffer( + cx, + &self.socket, + &self.shared.clock, + &self.shared.subscriber, + ); match res { Poll::Pending => break, diff --git a/dc/s2n-quic-dc/src/stream/send/application.rs b/dc/s2n-quic-dc/src/stream/send/application.rs index b846d4b4e..8ca366860 100644 --- a/dc/s2n-quic-dc/src/stream/send/application.rs +++ b/dc/s2n-quic-dc/src/stream/send/application.rs @@ -2,7 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{ - clock, event, msg, + clock, + event::{self, ConnectionPublisher}, + msg, stream::{ pacer, runtime, send::{flow, queue}, @@ -16,7 +18,7 @@ use core::{ sync::atomic::Ordering, task::{Context, Poll}, }; -use s2n_quic_core::{buffer, ensure, ready, task::waker}; +use s2n_quic_core::{buffer, ensure, ready, task::waker, time::Timestamp}; use std::{io, net::SocketAddr}; use tracing::trace; @@ -90,7 +92,10 @@ where where S: buffer::reader::storage::Infallible, { - waker::debug_assert_contract(cx, |cx| { + let start_time = self.0.shared.clock.get_time(); + let provided_len = buf.buffered_len(); + + let res = waker::debug_assert_contract(cx, |cx| { // if we've already shut down the stream then return early if !self.0.open { ensure!( @@ -111,7 +116,12 @@ where } res.into() - }) + }); + + self.0 + .publish_write_events(provided_len, is_fin, start_time, &res); + + res } /// Shutdown the stream for writing. @@ -243,6 +253,8 @@ where &msg::addr::Addr::new(self.shared.write_remote_addr()), &self.shared.sender.segment_alloc, &self.shared.gso, + &self.shared.clock, + &self.shared.subscriber, ))?; Ok(len).into() @@ -283,16 +295,34 @@ where self.sockets.write_application().send_finish()?; } + let buffer_len = queue.accepted_len(); + // pass things to the worker if we need to gracefully shut down if !self.sockets.write_application().features().is_stream() { + self.shared + .publisher() + .on_stream_write_shutdown(event::builder::StreamWriteShutdown { + background: false, + buffer_len, + }); + let is_panicking = matches!(ty, ShutdownType::Drop { is_panicking: true }); self.shared.sender.shutdown(queue, is_panicking); return Ok(()); } + let background = !queue.is_empty(); + + self.shared + .publisher() + .on_stream_write_shutdown(event::builder::StreamWriteShutdown { + background, + buffer_len, + }); + // if we're using TCP and we get blocked from writing a final offset then spawn a task // to do it for us - if !queue.is_empty() { + if background { let shared = self.shared.clone(); let sockets = self.sockets.clone(); self.runtime.spawn_send_shutdown(Shutdown { @@ -305,6 +335,51 @@ where Ok(()) } + + #[inline(always)] + fn publish_write_events( + &self, + provided_len: usize, + is_fin: bool, + start_time: Timestamp, + result: &Poll>, + ) { + let end_time = self.shared.clock.get_time(); + let processing_duration = end_time.saturating_duration_since(start_time); + + match result { + Poll::Ready(Ok(len)) => { + self.shared.common.publisher().on_stream_write_flushed( + event::builder::StreamWriteFlushed { + provided_len, + committed_len: *len, + is_fin, + processing_duration, + }, + ); + } + Poll::Ready(Err(error)) => { + let errno = error.raw_os_error(); + self.shared.common.publisher().on_stream_write_errored( + event::builder::StreamWriteErrored { + provided_len, + is_fin, + processing_duration, + errno, + }, + ); + } + Poll::Pending => { + self.shared.common.publisher().on_stream_write_blocked( + event::builder::StreamWriteBlocked { + provided_len, + is_fin, + processing_duration, + }, + ); + } + }; + } } #[cfg(feature = "tokio")] @@ -403,6 +478,8 @@ where &msg::addr::Addr::new(shared.write_remote_addr()), &shared.sender.segment_alloc, &shared.gso, + &shared.clock, + &shared.subscriber, )); // If the application is explicitly shutting down then do the same. Otherwise let diff --git a/dc/s2n-quic-dc/src/stream/send/queue.rs b/dc/s2n-quic-dc/src/stream/send/queue.rs index e5caef531..e5aff89c8 100644 --- a/dc/s2n-quic-dc/src/stream/send/queue.rs +++ b/dc/s2n-quic-dc/src/stream/send/queue.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{ + event::{self, ConnectionPublisher}, msg::{addr, segment}, stream::{ send::{ @@ -9,12 +10,15 @@ use crate::{ buffer, state::Transmission, }, + shared, socket::Socket, }, }; use bytes::buf::UninitSlice; use core::task::{Context, Poll}; -use s2n_quic_core::{assume, buffer::reader, ensure, inet::ExplicitCongestionNotification, ready}; +use s2n_quic_core::{ + assume, buffer::reader, ensure, inet::ExplicitCongestionNotification, ready, time::Clock, +}; use s2n_quic_platform::features::Gso; use std::{collections::VecDeque, io}; @@ -154,7 +158,7 @@ impl Queue { } #[inline] - pub fn poll_flush( + pub fn poll_flush( &mut self, cx: &mut Context, limit: usize, @@ -162,11 +166,15 @@ impl Queue { addr: &addr::Addr, segment_alloc: &buffer::Allocator, gso: &Gso, + clock: &C, + subscriber: &shared::Subscriber, ) -> Poll> where S: ?Sized + Socket, + C: ?Sized + Clock, + Sub: event::Subscriber, { - ready!(self.poll_flush_segments(cx, socket, addr, segment_alloc, gso))?; + ready!(self.poll_flush_segments(cx, socket, addr, segment_alloc, gso, clock, subscriber))?; // Consume accepted credits let accepted = limit.min(self.accepted_len); @@ -175,16 +183,20 @@ impl Queue { } #[inline] - fn poll_flush_segments( + fn poll_flush_segments( &mut self, cx: &mut Context, socket: &S, addr: &addr::Addr, segment_alloc: &buffer::Allocator, gso: &Gso, + clock: &C, + subscriber: &shared::Subscriber, ) -> Poll> where S: ?Sized + Socket, + C: ?Sized + Clock, + Sub: event::Subscriber, { ensure!(!self.segments.is_empty(), Poll::Ready(Ok(()))); @@ -198,45 +210,93 @@ impl Queue { }; if socket.features().is_stream() { - self.poll_flush_segments_stream(cx, socket, addr, segment_alloc) + self.poll_flush_segments_stream(cx, socket, addr, segment_alloc, clock, subscriber) } else { - self.poll_flush_segments_datagram(cx, socket, addr, segment_alloc, gso) + self.poll_flush_segments_datagram( + cx, + socket, + addr, + segment_alloc, + gso, + clock, + subscriber, + ) } } #[inline] - fn poll_flush_segments_stream( + fn poll_flush_segments_stream( &mut self, cx: &mut Context, socket: &S, addr: &addr::Addr, segment_alloc: &buffer::Allocator, + clock: &C, + subscriber: &shared::Subscriber, ) -> Poll> where S: ?Sized + Socket, + C: ?Sized + Clock, + Sub: event::Subscriber, { while !self.segments.is_empty() { - let segments = segment::Batch::new(self.segments.iter().map(|v| (v.ecn, v.as_slice()))); + let mut provided_len = 0; + let segments = segment::Batch::new(self.segments.iter().map(|v| { + let slice = v.as_slice(); + provided_len += slice.len(); + (v.ecn, v.as_slice()) + })); let ecn = segments.ecn(); - let res = ready!(socket.poll_send(cx, addr, ecn, &segments)); + let start_time = clock.get_time(); + + let result = socket.poll_send(cx, addr, ecn, &segments); + + let now = clock.get_time(); + let processing_duration = now.saturating_duration_since(start_time); drop(segments); - match res { - Ok(written_len) => { + match result { + Poll::Ready(Ok(written_len)) => { + subscriber.publisher(now).on_stream_write_socket_flushed( + event::builder::StreamWriteSocketFlushed { + provided_len, + committed_len: written_len, + processing_duration, + }, + ); + self.consume_segments(written_len, segment_alloc); // keep trying to drain the buffer continue; } - Err(err) => { + Poll::Ready(Err(err)) => { + subscriber.publisher(now).on_stream_write_socket_errored( + event::builder::StreamWriteSocketErrored { + provided_len, + processing_duration, + errno: err.raw_os_error(), + }, + ); + // the socket encountered an error so clear everything out since we're shutting // down self.segments.clear(); self.accepted_len = 0; return Err(err).into(); } + Poll::Pending => { + subscriber.publisher(now).on_stream_write_socket_blocked( + event::builder::StreamWriteSocketBlocked { + provided_len, + processing_duration, + }, + ); + + return Poll::Pending; + } } } @@ -277,37 +337,78 @@ impl Queue { } #[inline] - fn poll_flush_segments_datagram( + fn poll_flush_segments_datagram( &mut self, cx: &mut Context, socket: &S, addr: &addr::Addr, segment_alloc: &buffer::Allocator, gso: &Gso, + clock: &C, + subscriber: &shared::Subscriber, ) -> Poll> where S: ?Sized + Socket, + C: ?Sized + Clock, + Sub: event::Subscriber, { let mut max_segments = gso.max_segments(); while !self.segments.is_empty() { + let mut provided_len = 0; + // construct all of the segments we're going to send in this batch let segments = segment::Batch::new( self.segments .iter() - .map(|v| (v.ecn, v.as_slice())) + .map(|v| { + let slice = v.as_slice(); + provided_len += slice.len(); + (v.ecn, slice) + }) .take(max_segments), ); let ecn = segments.ecn(); - let res = match ready!(socket.poll_send(cx, addr, ecn, &segments)) { - Ok(_) => Ok(()), - Err(error) => { - if gso.handle_socket_error(&error).is_some() { + + let start_time = clock.get_time(); + let result = socket.poll_send(cx, addr, ecn, &segments); + + let now = clock.get_time(); + let processing_duration = now.saturating_duration_since(start_time); + + match &result { + Poll::Ready(Ok(_len)) => { + subscriber.publisher(now).on_stream_write_socket_flushed( + event::builder::StreamWriteSocketFlushed { + provided_len, + // if the syscall went through, then we wrote the whole thing + committed_len: provided_len, + processing_duration, + }, + ); + } + Poll::Ready(Err(error)) => { + subscriber.publisher(now).on_stream_write_socket_errored( + event::builder::StreamWriteSocketErrored { + provided_len, + processing_duration, + errno: error.raw_os_error(), + }, + ); + + if gso.handle_socket_error(error).is_some() { // update the max_segments value if it was changed due to the error max_segments = 1; } - Err(error) + } + Poll::Pending => { + subscriber.publisher(now).on_stream_write_socket_blocked( + event::builder::StreamWriteSocketBlocked { + provided_len, + processing_duration, + }, + ); } }; @@ -319,7 +420,7 @@ impl Queue { segment_alloc.free(segment.buffer); } - res?; + ready!(result)?; } Ok(()).into() diff --git a/dc/s2n-quic-dc/src/stream/send/worker.rs b/dc/s2n-quic-dc/src/stream/send/worker.rs index 2c5f3177d..38bf7f265 100644 --- a/dc/s2n-quic-dc/src/stream/send/worker.rs +++ b/dc/s2n-quic-dc/src/stream/send/worker.rs @@ -402,6 +402,8 @@ where &addr::Addr::new(self.shared.write_remote_addr()), &self.shared.sender.segment_alloc, &self.shared.gso, + &self.shared.clock, + &self.shared.subscriber, )); // make sure we have the current view from the application diff --git a/dc/s2n-quic-dc/src/stream/shared.rs b/dc/s2n-quic-dc/src/stream/shared.rs index a1f25f04f..07e70f5b6 100644 --- a/dc/s2n-quic-dc/src/stream/shared.rs +++ b/dc/s2n-quic-dc/src/stream/shared.rs @@ -168,8 +168,7 @@ where /// The last time we received a packet from the peer pub last_peer_activity: AtomicU64, pub closed_halves: AtomicU8, - pub subscriber: Sub, - pub subscriber_ctx: Sub::ConnectionContext, + pub subscriber: Subscriber, pub clock: Clock, } @@ -192,7 +191,47 @@ where ); Ok(()) } +} + +impl Common +where + Sub: event::Subscriber, + Clock: ?Sized + s2n_quic_core::time::Clock, +{ + #[inline] + pub fn publisher(&self) -> event::ConnectionPublisherSubscriber { + self.publisher_with_timestamp(self.clock.get_time()) + } + + #[inline] + pub fn publisher_with_timestamp( + &self, + timestamp: Timestamp, + ) -> event::ConnectionPublisherSubscriber { + self.subscriber.publisher(timestamp) + } + #[inline] + pub fn endpoint_publisher( + &self, + timestamp: Timestamp, + ) -> event::EndpointPublisherSubscriber { + self.subscriber.endpoint_publisher(timestamp) + } +} + +pub struct Subscriber +where + Sub: event::Subscriber, +{ + pub subscriber: Sub, + pub context: Sub::ConnectionContext, +} + +impl Subscriber +where + Sub: event::Subscriber, +{ #[inline] pub fn publisher(&self, timestamp: Timestamp) -> event::ConnectionPublisherSubscriber { event::ConnectionPublisherSubscriber::new( @@ -202,7 +241,7 @@ where }, 0, &self.subscriber, - &self.subscriber_ctx, + &self.context, ) }