pub struct HttpMetrics;Expand description
Helper struct for recording HTTP metrics
Implementations§
Source§impl HttpMetrics
impl HttpMetrics
Sourcepub fn record_request(method: &str, status: u16, duration_secs: f64)
pub fn record_request(method: &str, status: u16, duration_secs: f64)
Record a completed HTTP request
Sourcepub fn record_error(error_type: &str)
pub fn record_error(error_type: &str)
Record an HTTP request error
Sourcepub fn record_ip_retry(success: bool, failure_reason: Option<&str>)
pub fn record_ip_retry(success: bool, failure_reason: Option<&str>)
Record IP retry attempt
Sourcepub fn record_dns_cache(is_hit: bool)
pub fn record_dns_cache(is_hit: bool)
Record DNS cache hit/miss
Sourcepub fn record_dns_resolution(success: bool)
pub fn record_dns_resolution(success: bool)
Record DNS resolution result
Sourcepub fn record_request_body_size(method: &str, size: usize)
pub fn record_request_body_size(method: &str, size: usize)
Record request body size
Sourcepub fn record_response_body_size(status: u16, size: usize)
pub fn record_response_body_size(status: u16, size: usize)
Record response body size
Sourcepub fn record_tls_handshake(duration_secs: f64, success: bool)
pub fn record_tls_handshake(duration_secs: f64, success: bool)
Record TLS handshake duration
Sourcepub fn record_tls_error(error_type: &str)
pub fn record_tls_error(error_type: &str)
Record TLS handshake error
Sourcepub fn record_connection(duration_secs: f64, success: bool)
pub fn record_connection(duration_secs: f64, success: bool)
Record connection duration
Sourcepub fn record_ssrf_block(reason: &str)
pub fn record_ssrf_block(reason: &str)
Record SSRF block
Sourcepub fn record_rate_limit_hit(token_id: &str)
pub fn record_rate_limit_hit(token_id: &str)
Record rate limit hit
Sourcepub fn record_ip_limit_violation(token_id: &str)
pub fn record_ip_limit_violation(token_id: &str)
Record IP limit violation
Sourcepub fn record_chunked_response(was_dechunked: bool)
pub fn record_chunked_response(was_dechunked: bool)
Record chunked response
Sourcepub fn record_content_length_mismatch(expected: usize, actual: usize)
pub fn record_content_length_mismatch(expected: usize, actual: usize)
Record Content-Length mismatch
Sourcepub fn record_mixed_content_detected(policy_action: &str)
pub fn record_mixed_content_detected(policy_action: &str)
Record mixed content detection
Sourcepub fn record_mixed_content_allowed(reason: &str)
pub fn record_mixed_content_allowed(reason: &str)
Record mixed content allowed
Sourcepub fn record_mixed_content_blocked(reason: &str)
pub fn record_mixed_content_blocked(reason: &str)
Record mixed content blocked
Sourcepub fn record_mixed_content_upgraded(result: &str)
pub fn record_mixed_content_upgraded(result: &str)
Record successful HTTP→HTTPS upgrade
Sourcepub fn record_mixed_content_upgrade_failed(failure_reason: &str)
pub fn record_mixed_content_upgrade_failed(failure_reason: &str)
Record failed HTTP→HTTPS upgrade
Sourcepub fn record_upgrade_probe_duration(duration_secs: f64, success: bool)
pub fn record_upgrade_probe_duration(duration_secs: f64, success: bool)
Record HTTPS probe duration
Auto Trait Implementations§
impl Freeze for HttpMetrics
impl RefUnwindSafe for HttpMetrics
impl Send for HttpMetrics
impl Sync for HttpMetrics
impl Unpin for HttpMetrics
impl UnwindSafe for HttpMetrics
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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