mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
explicitly dump metrics on shutdown
This commit is contained in:
@@ -190,7 +190,7 @@ mod imp {
|
||||
pub(crate) fn inc_num_driver_wakes_no_core() {}
|
||||
|
||||
impl super::Counters {
|
||||
pub(crate) fn dump(&mut self, _: &[WorkerMetrics]) {}
|
||||
pub(crate) fn dump(&self, _: &[WorkerMetrics]) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -178,12 +178,6 @@ pub(crate) struct Shared {
|
||||
counters: Counters,
|
||||
}
|
||||
|
||||
impl Drop for Shared {
|
||||
fn drop(&mut self) {
|
||||
self.counters.dump(&self.worker_metrics);
|
||||
}
|
||||
}
|
||||
|
||||
/// Data synchronized by the scheduler mutex
|
||||
pub(crate) struct Synced {
|
||||
/// When worker is notified, it is assigned a core. The core is placed here
|
||||
@@ -1512,6 +1506,9 @@ impl Shared {
|
||||
while let Some(task) = self.next_remote_task_synced(synced) {
|
||||
drop(task);
|
||||
}
|
||||
|
||||
// Drop counters if enabled
|
||||
handle.shared.counters.dump(&handle.shared.worker_metrics);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user