1 #![cfg_attr(not(feature = "net"), allow(dead_code))] 2 3 use crate::loom::sync::atomic::{AtomicU64, Ordering::Relaxed}; 4 5 #[derive(Default)] 6 pub(crate) struct IoDriverMetrics { 7 pub(super) fd_registered_count: AtomicU64, 8 pub(super) fd_deregistered_count: AtomicU64, 9 pub(super) ready_count: AtomicU64, 10 } 11 12 impl IoDriverMetrics { incr_fd_count(&self)13 pub(crate) fn incr_fd_count(&self) { 14 self.fd_registered_count.fetch_add(1, Relaxed); 15 } 16 dec_fd_count(&self)17 pub(crate) fn dec_fd_count(&self) { 18 self.fd_deregistered_count.fetch_add(1, Relaxed); 19 } 20 incr_ready_count_by(&self, amt: u64)21 pub(crate) fn incr_ready_count_by(&self, amt: u64) { 22 self.ready_count.fetch_add(amt, Relaxed); 23 } 24 } 25