pub struct Profile {
pub start_time: u64,
pub end_time: u64,
pub samples: HashMap<Stack, u64>,
pub total_samples: u64,
pub sample_period_ns: u64,
}Expand description
Aggregated profile data for a time period
Fields§
§start_time: u64Start timestamp of the profile period
end_time: u64End timestamp of the profile period
samples: HashMap<Stack, u64>Sample counts per stack trace
total_samples: u64Total number of samples
sample_period_ns: u64Sampling period in nanoseconds
Implementations§
Source§impl Profile
impl Profile
Sourcepub fn new(start_time: u64, end_time: u64, sample_period_ns: u64) -> Self
pub fn new(start_time: u64, end_time: u64, sample_period_ns: u64) -> Self
Create a new empty profile
Sourcepub fn add_sample(&mut self, stack: Stack)
pub fn add_sample(&mut self, stack: Stack)
Add a sample to the profile
Sourcepub fn duration_ns(&self) -> u64
pub fn duration_ns(&self) -> u64
Get the duration of the profile in nanoseconds
Sourcepub fn sampling_rate_hz(&self) -> f64
pub fn sampling_rate_hz(&self) -> f64
Get the sampling rate in Hz
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Profile
impl<'de> Deserialize<'de> for Profile
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
Auto Trait Implementations§
impl Freeze for Profile
impl RefUnwindSafe for Profile
impl Send for Profile
impl Sync for Profile
impl Unpin for Profile
impl UnsafeUnpin for Profile
impl UnwindSafe for Profile
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