use crate::loom::sync::atomic::Ordering::Relaxed;
use crate::util::metric_atomics::MetricAtomicU64;
#[derive(Debug)]
pub(crate) struct SchedulerMetrics {
pub(super) remote_schedule_count: MetricAtomicU64,
pub(super) budget_forced_yield_count: MetricAtomicU64,
}
impl SchedulerMetrics {
pub(crate) fn new() -> SchedulerMetrics {
SchedulerMetrics {
remote_schedule_count: MetricAtomicU64::new(0),
budget_forced_yield_count: MetricAtomicU64::new(0),
}
}
pub(crate) fn inc_remote_schedule_count(&self) {
self.remote_schedule_count.add(1, Relaxed);
}
pub(crate) fn inc_budget_forced_yield_count(&self) {
self.budget_forced_yield_count.add(1, Relaxed);
}
}