pub struct ProfileConfig { /* private fields */ }Expand description
Configuration for the profiling layer.
By default all metric collection is disabled.
Implementations§
Source§impl ProfileConfig
impl ProfileConfig
Sourcepub fn track_allocations(self, enable: bool) -> Self
pub fn track_allocations(self, enable: bool) -> Self
Enable/disable tracking of allocations.
In order to track allocations, the global allocator must be
set to TrackingAllocator.
By default, this is disabled.
Sourcepub fn track_heap(self, enable: bool) -> Self
pub fn track_heap(self, enable: bool) -> Self
Enable/disable tracking of heap usage.
Implicitly enables tracking of allocations.
By default, this is disabled.
Sourcepub fn track_cpu(self, enable: bool) -> Self
pub fn track_cpu(self, enable: bool) -> Self
Enable/disable tracking of CPU time.
By default, this is disabled.
Sourcepub fn track_wall(self, enable: bool) -> Self
pub fn track_wall(self, enable: bool) -> Self
Enable/disable tracking of wall time.
By default, this is disabled.
Sourcepub fn record_labels(self, labels: &[&str]) -> Self
pub fn record_labels(self, labels: &[&str]) -> Self
Use the given fields as labels for all spans.
By default, no labels are recorded as this is an expensive operation.
Sourcepub fn heap_snapshot_interval(self, interval: Duration) -> Self
pub fn heap_snapshot_interval(self, interval: Duration) -> Self
Set the heap snapshot interval for the reporter.
Pyroscope will sum snapshot values if they are too frequent, this is a (hopefully) temporary workaround to avoid that.
Set this to 0 to send heap snapshots on every poll.
By default, this is 10 seconds.
Sourcepub fn max_samples(self, max_samples: usize) -> Self
pub fn max_samples(self, max_samples: usize) -> Self
Set the maximum number of samples to accumulate before flushing.
Note that this is a soft limit, the reporter may flush more often or less often depending on the load.
By default, this is 1000.
Sourcepub fn max_closed_heap_spans(self, max_closed_heap_spans: usize) -> Self
pub fn max_closed_heap_spans(self, max_closed_heap_spans: usize) -> Self
Set the maximum number of closed spans to keep in the heap tracker. If this is exceeded, closed spans will be dropped from heap tracking.
Spans with the lowest amount of allocated bytes still in use will be dropped first.
By default, this is 1000.
Trait Implementations§
Source§impl Clone for ProfileConfig
impl Clone for ProfileConfig
Source§fn clone(&self) -> ProfileConfig
fn clone(&self) -> ProfileConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more