Skip to content

Commit

Permalink
feat(s2n-quic-core): add metrics trait
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft committed Sep 26, 2024
1 parent e0ffbda commit 8ee9589
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions quic/s2n-quic-core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
use crate::{connection, endpoint};
use core::{ops::RangeInclusive, time::Duration};

pub mod metrics;

mod generated;
pub use generated::*;

Expand Down
11 changes: 11 additions & 0 deletions quic/s2n-quic-core/src/event/metrics.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

/// A Recorder should arrange to emit the properties and counters on Drop into some output.
pub trait Recorder: 'static + Send + Sync {
/// Registers a counter with the recorder instance
fn increment_counter(&self, name: &str, amount: usize);

/// Associates a key/value pair with the recorder instance
fn set_value<V: core::fmt::Display>(&self, key: &str, value: V);
}

0 comments on commit 8ee9589

Please sign in to comment.