pub struct CdkMetrics { /* private fields */ }Expand description
Custom metrics for CDK applications
Implementations§
Source§impl CdkMetrics
impl CdkMetrics
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new instance with default metrics
§Errors
Returns an error if any of the metrics cannot be created or registered
Sourcepub fn record_http_request(&self, endpoint: &str, status: &str)
pub fn record_http_request(&self, endpoint: &str, status: &str)
Record an HTTP request
Sourcepub fn record_http_request_duration(
&self,
duration_seconds: f64,
endpoint: &str,
)
pub fn record_http_request_duration( &self, duration_seconds: f64, endpoint: &str, )
Record HTTP request duration
Sourcepub fn record_auth_attempt(&self)
pub fn record_auth_attempt(&self)
Record an authentication attempt
Sourcepub fn record_auth_success(&self)
pub fn record_auth_success(&self)
Record a successful authentication
Sourcepub fn record_lightning_payment(&self, amount: f64, fee: f64)
pub fn record_lightning_payment(&self, amount: f64, fee: f64)
Record a Lightning payment
Sourcepub fn record_db_operation(&self, duration_seconds: f64, op: &str)
pub fn record_db_operation(&self, duration_seconds: f64, op: &str)
Record a database operation
Sourcepub fn set_db_connections_active(&self, count: i64)
pub fn set_db_connections_active(&self, count: i64)
Set the number of active database connections
Sourcepub fn record_error(&self)
pub fn record_error(&self)
Record an error
Sourcepub fn record_mint_operation(&self, operation: &str, success: bool)
pub fn record_mint_operation(&self, operation: &str, success: bool)
Record a mint operation
Sourcepub fn record_mint_operation_histogram(
&self,
operation: &str,
success: bool,
duration_seconds: f64,
)
pub fn record_mint_operation_histogram( &self, operation: &str, success: bool, duration_seconds: f64, )
Record a mint operation with duration
Sourcepub fn inc_in_flight_requests(&self, operation: &str)
pub fn inc_in_flight_requests(&self, operation: &str)
Increment in-flight mint requests
Sourcepub fn dec_in_flight_requests(&self, operation: &str)
pub fn dec_in_flight_requests(&self, operation: &str)
Decrement in-flight mint requests
Trait Implementations§
Source§impl Clone for CdkMetrics
impl Clone for CdkMetrics
Source§fn clone(&self) -> CdkMetrics
fn clone(&self) -> CdkMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CdkMetrics
impl Debug for CdkMetrics
Auto Trait Implementations§
impl Freeze for CdkMetrics
impl !RefUnwindSafe for CdkMetrics
impl Send for CdkMetrics
impl Sync for CdkMetrics
impl Unpin for CdkMetrics
impl UnsafeUnpin for CdkMetrics
impl !UnwindSafe for CdkMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more