From c7e8d5c5cd67879c400885a7cbf6700f3742779e Mon Sep 17 00:00:00 2001 From: Zhe Wu Date: Wed, 17 Jan 2024 14:36:44 -0800 Subject: [PATCH] HistogramCollector format cleanup (#15753) ## Description Describe the changes or additions included in this PR. ## Test Plan How did you test the new or updated feature? --- If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes --- crates/mysten-metrics/src/histogram.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/mysten-metrics/src/histogram.rs b/crates/mysten-metrics/src/histogram.rs index 2125ac3c35c3c8..8e7d8bf4aa67c3 100644 --- a/crates/mysten-metrics/src/histogram.rs +++ b/crates/mysten-metrics/src/histogram.rs @@ -224,9 +224,7 @@ impl HistogramCollector { const MAX_POINTS: usize = 500_000; loop { tokio::select! { - _ = &mut timeout => { - break; - }, + _ = &mut timeout => break, point = self.channel.recv() => { count += 1; if count > MAX_POINTS { @@ -239,8 +237,8 @@ impl HistogramCollector { // Histogram no longer exists return Err(()); } - } - } + }, + } } if count > MAX_POINTS { error!(