pub struct ProfileData {Show 15 fields
pub id: String,
pub timestamp: DateTime<Utc>,
pub duration_ms: f64,
pub operation: String,
pub component: String,
pub user_id: Option<String>,
pub session_id: Option<String>,
pub trace_id: Option<String>,
pub cpu_usage_percent: Option<f64>,
pub memory_usage_mb: Option<f64>,
pub io_read_bytes: Option<u64>,
pub io_write_bytes: Option<u64>,
pub custom_metrics: HashMap<String, f64>,
pub stack_trace: Option<String>,
pub tags: HashMap<String, String>,
}Expand description
Profile data collection
Fields§
§id: String§timestamp: DateTime<Utc>§duration_ms: f64§operation: String§component: String§user_id: Option<String>§session_id: Option<String>§trace_id: Option<String>§cpu_usage_percent: Option<f64>§memory_usage_mb: Option<f64>§io_read_bytes: Option<u64>§io_write_bytes: Option<u64>§custom_metrics: HashMap<String, f64>§stack_trace: Option<String>Implementations§
Source§impl ProfileData
impl ProfileData
pub fn new(operation: impl Into<String>, component: impl Into<String>) -> Self
pub fn with_duration(self, duration_ms: f64) -> Self
pub fn with_user(self, user_id: impl Into<String>) -> Self
pub fn with_session(self, session_id: impl Into<String>) -> Self
pub fn with_trace(self, trace_id: impl Into<String>) -> Self
pub fn with_cpu_usage(self, cpu_percent: f64) -> Self
pub fn with_memory_usage(self, memory_mb: f64) -> Self
pub fn with_io(self, read_bytes: u64, write_bytes: u64) -> Self
pub fn with_custom_metric(self, name: impl Into<String>, value: f64) -> Self
pub fn with_tag(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_stack_trace(self, trace: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for ProfileData
impl Clone for ProfileData
Source§fn clone(&self) -> ProfileData
fn clone(&self) -> ProfileData
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 ProfileData
impl Debug for ProfileData
Source§impl<'de> Deserialize<'de> for ProfileData
impl<'de> Deserialize<'de> for ProfileData
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 RetentionData for ProfileData
impl RetentionData for ProfileData
Auto Trait Implementations§
impl Freeze for ProfileData
impl RefUnwindSafe for ProfileData
impl Send for ProfileData
impl Sync for ProfileData
impl Unpin for ProfileData
impl UnwindSafe for ProfileData
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