add num_workers() convenience to core metrics
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
71673b2a88
commit
6c42ac2726
1 changed files with 8 additions and 0 deletions
|
@ -66,8 +66,16 @@ impl Metrics {
|
|||
.expect("next interval")
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn task_root(&self) -> Option<&TaskMonitor> { self.task_monitor.as_ref() }
|
||||
|
||||
#[inline]
|
||||
pub fn num_workers(&self) -> usize {
|
||||
self.runtime_metrics()
|
||||
.map_or(0, runtime::RuntimeMetrics::num_workers)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn runtime_metrics(&self) -> Option<&runtime::RuntimeMetrics> {
|
||||
self.runtime_metrics.as_ref()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue