pub struct Store {
pub(crate) spans: ChunkedVec<Span>,
pub(crate) self_time_tree: Option<SelfTimeTree<NonZeroUsize>>,
max_self_time_lookup_time: AtomicU64,
memory_samples: Vec<(Timestamp, u64, u8)>,
}Fields§
§spans: ChunkedVec<Span>§self_time_tree: Option<SelfTimeTree<NonZeroUsize>>§max_self_time_lookup_time: AtomicU64§memory_samples: Vec<(Timestamp, u64, u8)>Global sorted list of memory samples (timestamp, memory_bytes).
Implementations§
Source§impl Store
impl Store
pub fn new() -> Self
pub fn reset(&mut self)
pub fn optimize(&mut self)
pub fn has_time_info(&self) -> bool
pub fn add_span( &mut self, parent: Option<NonZeroUsize>, start: Timestamp, category: RcStr, name: RcStr, args: SmallVec<[(RcStr, RcStr); 1]>, outdated_spans: &mut FxHashSet<NonZeroUsize>, ) -> NonZeroUsize
pub fn add_args( &mut self, span_index: NonZeroUsize, args: SmallVec<[(RcStr, RcStr); 1]>, outdated_spans: &mut FxHashSet<NonZeroUsize>, )
pub fn set_max_self_time_lookup(&self, time: Timestamp)
fn insert_self_time( &mut self, start: Timestamp, end: Timestamp, span_index: NonZeroUsize, outdated_spans: &mut FxHashSet<NonZeroUsize>, )
pub fn add_self_time( &mut self, span_index: NonZeroUsize, start: Timestamp, end: Timestamp, outdated_spans: &mut FxHashSet<NonZeroUsize>, )
pub fn set_total_time( &mut self, span_index: NonZeroUsize, start_time: Timestamp, total_time: Timestamp, outdated_spans: &mut FxHashSet<NonZeroUsize>, )
pub fn set_parent( &mut self, span_index: NonZeroUsize, parent: NonZeroUsize, outdated_spans: &mut FxHashSet<NonZeroUsize>, )
pub fn add_allocation( &mut self, span_index: NonZeroUsize, allocation: u64, count: u64, outdated_spans: &mut FxHashSet<NonZeroUsize>, )
pub fn add_deallocation( &mut self, span_index: NonZeroUsize, deallocation: u64, count: u64, outdated_spans: &mut FxHashSet<NonZeroUsize>, )
pub fn add_memory_sample( &mut self, ts: Timestamp, memory: u64, memory_pressure: u8, )
Sourcepub fn memory_samples_for_range(
&self,
start: Timestamp,
end: Timestamp,
) -> Vec<u64>
pub fn memory_samples_for_range( &self, start: Timestamp, end: Timestamp, ) -> Vec<u64>
Returns up to MAX_MEMORY_SAMPLES memory samples in the range
[start, end]. When more samples exist, groups of N consecutive
samples are merged by taking the maximum memory value in each group.
Sourcepub fn memory_samples_for_range_with_ts(
&self,
start: Timestamp,
end: Timestamp,
) -> Vec<(Timestamp, u64, u8)>
pub fn memory_samples_for_range_with_ts( &self, start: Timestamp, end: Timestamp, ) -> Vec<(Timestamp, u64, u8)>
Like memory_samples_for_range but keeps the timestamps and the
memory-pressure byte. Timestamps are absolute store timestamps (same
reference frame as span start/end). When the raw slice exceeds
MAX_MEMORY_SAMPLES, each merged group is represented by the sample
whose memory value was the group’s max (its timestamp and pressure
byte are kept alongside it).
Sourcepub fn memory_pressure_samples_for_range(
&self,
start: Timestamp,
end: Timestamp,
) -> Vec<u8> ⓘ
pub fn memory_pressure_samples_for_range( &self, start: Timestamp, end: Timestamp, ) -> Vec<u8> ⓘ
Returns up to MAX_MEMORY_SAMPLES memory pressure values in the range
[start, end]. The returned slice has the same length and group
boundaries as Self::memory_samples_for_range so that the two
results can be rendered in parallel. Each group is downsampled by
taking the maximum pressure value.
fn memory_samples_slice( &self, start: Timestamp, end: Timestamp, ) -> &[(Timestamp, u64, u8)]
pub fn complete_span(&mut self, span_index: NonZeroUsize)
pub fn invalidate_outdated_spans( &mut self, outdated_spans: &FxHashSet<NonZeroUsize>, )
pub fn root_spans(&self) -> impl Iterator<Item = SpanRef<'_>>
pub fn root_span(&self) -> SpanRef<'_>
pub fn span(&self, id: NonZeroUsize) -> Option<(SpanRef<'_>, bool)>
Auto Trait Implementations§
impl !Freeze for Store
impl !RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
impl UnwindSafe for Store
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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