Be more specific with metrics names
Some checks failed
Some checks failed
This commit is contained in:
parent
ef87e497cf
commit
8acca96611
|
@ -594,7 +594,7 @@ struct MetricsGuard {
|
|||
impl MetricsGuard {
|
||||
fn guard(name: &'static str, id: u64) -> Self {
|
||||
tracing::trace!("Starting {name}-{id}");
|
||||
metrics::counter!(format!("async-cpupool.{name}.launched")).increment(1);
|
||||
metrics::counter!(format!("async-cpupool.{name}.thread.launched")).increment(1);
|
||||
|
||||
MetricsGuard {
|
||||
name,
|
||||
|
@ -611,8 +611,8 @@ impl MetricsGuard {
|
|||
|
||||
impl Drop for MetricsGuard {
|
||||
fn drop(&mut self) {
|
||||
metrics::counter!(format!("async-cpupool.{}.closed", self.name), "clean" => (!self.armed).to_string()).increment(1);
|
||||
metrics::histogram!(format!("async-cpupool.{}.seconds", self.name), "clean" => (!self.armed).to_string()).record(self.start.elapsed().as_secs_f64());
|
||||
metrics::counter!(format!("async-cpupool.{}.thread.closed", self.name), "clean" => (!self.armed).to_string()).increment(1);
|
||||
metrics::histogram!(format!("async-cpupool.{}.thread.seconds", self.name), "clean" => (!self.armed).to_string()).record(self.start.elapsed().as_secs_f64());
|
||||
tracing::trace!("Stopping {}-{}", self.name, self.id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue