explicitly dump metrics on shutdown

This commit is contained in:
Carl Lerche
2023-08-17 10:27:00 -07:00
parent 63856b7bc1
commit 481e78e912
2 changed files with 4 additions and 7 deletions
@@ -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);
}
}