diff options
Diffstat (limited to 'src/runtime/io/metrics.rs')
-rw-r--r-- | src/runtime/io/metrics.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/runtime/io/metrics.rs b/src/runtime/io/metrics.rs new file mode 100644 index 0000000..ec341ef --- /dev/null +++ b/src/runtime/io/metrics.rs @@ -0,0 +1,24 @@ +//! This file contains mocks of the metrics types used in the I/O driver. +//! +//! The reason these mocks don't live in `src/runtime/mock.rs` is because +//! these need to be available in the case when `net` is enabled but +//! `rt` is not. + +cfg_not_rt_and_metrics_and_net! { + #[derive(Default)] + pub(crate) struct IoDriverMetrics {} + + impl IoDriverMetrics { + pub(crate) fn incr_fd_count(&self) {} + pub(crate) fn dec_fd_count(&self) {} + pub(crate) fn incr_ready_count_by(&self, _amt: u64) {} + } +} + +cfg_net! { + cfg_rt! { + cfg_metrics! { + pub(crate) use crate::runtime::IoDriverMetrics; + } + } +} |