1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! Read-only access to runtime observations; callers cannot construct internal state.
impl crate::RuntimeStats {
/// Tasks accepted by the runtime.
pub fn admitted(&self) -> u64 {
self.admitted
}
/// Tasks that returned normally.
pub fn completed(&self) -> u64 {
self.completed
}
/// Tasks that panicked.
pub fn panicked(&self) -> u64 {
self.panicked
}
/// Total stack mounts.
pub fn mounts(&self) -> u64 {
self.mounts
}
/// Total cooperative yields.
pub fn yields(&self) -> u64 {
self.yields
}
/// Total modeled park operations.
pub fn parks(&self) -> u64 {
self.parks
}
/// Parked generations made runnable again.
pub fn wakes(&self) -> u64 {
self.wakes
}
/// Wake selections caused by monotonic deadlines.
pub fn timeouts(&self) -> u64 {
self.timeouts
}
/// Wake selections caused by explicit cancellation.
pub fn cancelled(&self) -> u64 {
self.cancelled
}
/// Wake selections caused by permanent close.
pub fn closed(&self) -> u64 {
self.closed
}
/// Carrier sleeps while waiting for the next timer.
pub fn timer_sleeps(&self) -> u64 {
self.timer_sleeps
}
/// Wake notices ignored after their generation was no longer parked.
pub fn stale_wakes(&self) -> u64 {
self.stale_wakes
}
/// Tasks discarded while recovering a stalled scope.
pub fn aborted(&self) -> u64 {
self.aborted
}
/// Spawn attempts rejected at capacity.
pub fn rejected(&self) -> u64 {
self.rejected
}
}
impl crate::StackSnapshot {
/// Stacks currently retained.
pub fn cached(&self) -> usize {
self.cached
}
/// Fresh stack mappings created.
pub fn allocated(&self) -> u64 {
self.allocated
}
/// Cached stacks reused.
pub fn reused(&self) -> u64 {
self.reused
}
/// Completed stacks retained.
pub fn retained(&self) -> u64 {
self.retained
}
/// Completed stacks discarded at the cache limit.
pub fn discarded(&self) -> u64 {
self.discarded
}
}
#[cfg(test)]
#[path = "metrics_accessors_test.rs"]
mod metrics_accessors_test;