From c16f43b2f47d192d6dbbfd2bab6e1bad6e4f5d78 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Sun, 1 Sep 2024 19:34:05 -0700 Subject: [PATCH] remove extraneous import, add recorders_len and targets_len --- metrics-tracing-context/src/label_filter.rs | 2 +- metrics-util/src/layers/fanout.rs | 8 ++++++-- metrics-util/src/layers/router.rs | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/metrics-tracing-context/src/label_filter.rs b/metrics-tracing-context/src/label_filter.rs index 139f7716..fa42fc80 100644 --- a/metrics-tracing-context/src/label_filter.rs +++ b/metrics-tracing-context/src/label_filter.rs @@ -1,6 +1,6 @@ //! Label filtering. -use std::{collections::HashSet, fmt::Debug}; +use std::collections::HashSet; use metrics::{KeyName, Label}; diff --git a/metrics-util/src/layers/fanout.rs b/metrics-util/src/layers/fanout.rs index 2c344510..60c67227 100644 --- a/metrics-util/src/layers/fanout.rs +++ b/metrics-util/src/layers/fanout.rs @@ -105,7 +105,9 @@ pub struct Fanout { impl fmt::Debug for Fanout { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Fanout").finish_non_exhaustive() + f.debug_struct("Fanout") + .field("recorders_len", &self.recorders.len()) + .finish_non_exhaustive() } } @@ -166,7 +168,9 @@ pub struct FanoutBuilder { impl fmt::Debug for FanoutBuilder { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("FanoutBuilder").finish_non_exhaustive() + f.debug_struct("FanoutBuilder") + .field("recorders_len", &self.recorders.len()) + .finish_non_exhaustive() } } diff --git a/metrics-util/src/layers/router.rs b/metrics-util/src/layers/router.rs index 020c1a45..a4e4beba 100644 --- a/metrics-util/src/layers/router.rs +++ b/metrics-util/src/layers/router.rs @@ -21,6 +21,7 @@ impl fmt::Debug for Router { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Router") .field("global_mask", &self.global_mask) + .field("targets_len", &self.targets.len()) .field("counter_routes", &self.counter_routes) .field("gauge_routes", &self.gauge_routes) .field("histogram_routes", &self.histogram_routes) @@ -103,6 +104,7 @@ impl fmt::Debug for RouterBuilder { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("RouterBuilder") .field("global_mask", &self.global_mask) + .field("targets_len", &self.targets.len()) .field("counter_routes", &self.counter_routes) .field("gauge_routes", &self.gauge_routes) .field("histogram_routes", &self.histogram_routes)