Skip to content

Commit

Permalink
feat(s2n-quic-dc): implement cache events (#2386)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored Nov 22, 2024
1 parent 23df2c5 commit c84ba19
Show file tree
Hide file tree
Showing 13 changed files with 536 additions and 117 deletions.
26 changes: 26 additions & 0 deletions dc/s2n-quic-dc/events/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,29 @@ struct StaleKeyPacketDropped<'a> {
#[snapshot("[HIDDEN]")]
credential_id: &'a [u8],
}

#[event("path_secret_map:address_cache_accessed")]
#[subject(endpoint)]
/// Emitted when the cache is accessed by peer address
///
/// This can be used to track cache hit ratios
struct PathSecretMapAddressCacheAccessed<'a> {
#[nominal_counter("peer_address.protocol")]
peer_address: SocketAddress<'a>,

#[bool_counter("hit")]
hit: bool,
}

#[event("path_secret_map:id_cache_accessed")]
#[subject(endpoint)]
/// Emitted when the cache is accessed by path secret ID
///
/// This can be used to track cache hit ratios
struct PathSecretMapIdCacheAccessed<'a> {
#[snapshot("[HIDDEN]")]
credential_id: &'a [u8],

#[bool_counter("hit")]
hit: bool,
}
Loading

0 comments on commit c84ba19

Please sign in to comment.