pub struct Metrics {Show 13 fields
pub major_collections: AtomicU64,
pub minor_collections: AtomicU64,
pub major_collect_avg_time: AtomicU64,
pub minor_collect_avg_time: AtomicU64,
pub max_old_objects: AtomicU64,
pub old_objects_count: AtomicU64,
pub arena_size: AtomicU64,
pub prev_arena_size: AtomicU64,
pub state: AtomicU8,
pub max_yield_time: AtomicU64,
pub avg_yield_time: AtomicU64,
pub max_arena_size: AtomicU64,
pub monitor_is_on: bool,
}Expand description
A ‘snapshot’ of the metrics relevant to the GC’s internal triggers.
Obtained by calling crate::Arena::metrics.
Fields§
§major_collections: AtomicU64Number of major collections that have occured.
minor_collections: AtomicU64Number of minor collections that have occured.
major_collect_avg_time: AtomicU64Average time that takes for a major collection to complete.
minor_collect_avg_time: AtomicU64Average time that takes for a minor collection to complete.
max_old_objects: AtomicU64Once the old objects count reaches this number, a major collection will be triggered
old_objects_count: AtomicU64Running total of object that have been traced since the last major collection and all succeeding minor collections.
arena_size: AtomicU64Total amount of memory allocated by the arena.
prev_arena_size: AtomicU64The arena size at the start of the last collection.
state: AtomicU8The current state of the GC.
max_yield_time: AtomicU64§avg_yield_time: AtomicU64§max_arena_size: AtomicU64§monitor_is_on: boolImplementations§
Source§impl Metrics
impl Metrics
pub fn new() -> Self
pub fn get_major_collections(&self) -> u64
pub fn get_minor_collections(&self) -> u64
pub fn update_minor_collection_avg_time(&self, new_value: u64)
pub fn update_major_collection_avg_time(&self, new_value: u64)
pub fn get_major_collect_avg_time(&self) -> u64
pub fn get_minor_collect_avg_time(&self) -> u64
pub fn get_max_old_objects(&self) -> u64
pub fn get_old_objects_count(&self) -> u64
pub fn get_arena_size(&self) -> u64
pub fn get_prev_arena_size(&self) -> u64
pub fn get_state(&self) -> u8
pub fn get_max_yield_time(&self) -> u64
pub fn get_avg_yield_time(&self) -> u64
pub fn get_max_arena_size(&self) -> u64
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnwindSafe for Metrics
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