pub struct MetricEntry<T>where
T: CollectibleMetrics,{
pub operation_id: String,
pub operation_type: String,
pub metrics: T,
pub started_at: DateTime<Utc>,
pub completed_at: DateTime<Utc>,
pub duration_ms: u64,
pub success: bool,
pub error_message: Option<String>,
pub metadata: HashMap<String, String>,
pub tags: Vec<String>,
}Expand description
Generic metric entry with timing and metadata
Fields§
§operation_id: String§operation_type: String§metrics: T§started_at: DateTime<Utc>§completed_at: DateTime<Utc>§duration_ms: u64§success: bool§error_message: Option<String>§metadata: HashMap<String, String>Implementations§
Source§impl<T> MetricEntry<T>where
T: CollectibleMetrics,
impl<T> MetricEntry<T>where
T: CollectibleMetrics,
pub fn new(operation_id: String, operation_type: String, metrics: T) -> Self
pub fn with_duration(self, duration: Duration) -> Self
pub fn with_error(self, error: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Trait Implementations§
Source§impl<T> Clone for MetricEntry<T>where
T: CollectibleMetrics + Clone,
impl<T> Clone for MetricEntry<T>where
T: CollectibleMetrics + Clone,
Source§fn clone(&self) -> MetricEntry<T>
fn clone(&self) -> MetricEntry<T>
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<T> Debug for MetricEntry<T>where
T: CollectibleMetrics + Debug,
impl<T> Debug for MetricEntry<T>where
T: CollectibleMetrics + Debug,
Source§impl<'de, T> Deserialize<'de> for MetricEntry<T>where
T: CollectibleMetrics + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for MetricEntry<T>where
T: CollectibleMetrics + Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Serialize for MetricEntry<T>where
T: CollectibleMetrics + Serialize,
impl<T> Serialize for MetricEntry<T>where
T: CollectibleMetrics + Serialize,
Auto Trait Implementations§
impl<T> Freeze for MetricEntry<T>where
T: Freeze,
impl<T> RefUnwindSafe for MetricEntry<T>where
T: RefUnwindSafe,
impl<T> Send for MetricEntry<T>
impl<T> Sync for MetricEntry<T>
impl<T> Unpin for MetricEntry<T>where
T: Unpin,
impl<T> UnwindSafe for MetricEntry<T>where
T: UnwindSafe,
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