1//! This file contains mocks of the types in src/runtime/metrics
2
3pub(crate) struct SchedulerMetrics {}
4
5pub(crate) struct WorkerMetrics {}
6
7pub(crate) struct MetricsBatch {}
8
9#[derive(Clone, Default)]
10pub(crate) struct HistogramBuilder {}
11
12impl SchedulerMetrics {
13 pub(crate) fn new() -> Self {
14 Self {}
15 }
16
17 /// Increment the number of tasks scheduled externally
18 pub(crate) fn inc_remote_schedule_count(&self) {}
19}
20
21impl WorkerMetrics {
22 pub(crate) fn new() -> Self {
23 Self {}
24 }
25
26 pub(crate) fn from_config(config: &crate::runtime::Config) -> Self {
27 // Prevent the dead-code warning from being triggered
28 let _ = &config.metrics_poll_count_histogram;
29 Self::new()
30 }
31
32 pub(crate) fn set_queue_depth(&self, _len: usize) {}
33}
34
35impl MetricsBatch {
36 pub(crate) fn new(_: &WorkerMetrics) -> Self {
37 Self {}
38 }
39
40 pub(crate) fn submit(&mut self, _to: &WorkerMetrics, _mean_poll_time: u64) {}
41 pub(crate) fn about_to_park(&mut self) {}
42 pub(crate) fn inc_local_schedule_count(&mut self) {}
43 pub(crate) fn start_processing_scheduled_tasks(&mut self) {}
44 pub(crate) fn end_processing_scheduled_tasks(&mut self) {}
45 pub(crate) fn start_poll(&mut self) {}
46 pub(crate) fn end_poll(&mut self) {}
47}
48
49cfg_rt_multi_thread! {
50 impl MetricsBatch {
51 pub(crate) fn incr_steal_count(&mut self, _by: u16) {}
52 pub(crate) fn incr_steal_operations(&mut self) {}
53 pub(crate) fn incr_overflow_count(&mut self) {}
54 }
55}
56