Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 6debcdb

Browse files
authored
metrics: Increase the resolution of histogram metrics (#7335)
* metrics: Increase the resolution of histogram metrics These metrics are using the default histogram buckets: ``` pub const DEFAULT_BUCKETS: &[f64; 11] = &[ 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0, ]; ``` Which give us a resolution of 5ms, that's good, but there are some subsystems where we process hundreds or even a few thousands of messages per second like approval-voting or approval-distribution, so it makes sense to increse the resoution of the bucket to better understand if the procesisng is in the range of useconds. The new bucket ranges will be: ``` [0.0001, 0.0004, 0.0016, 0.0064, 0.0256, 0.1024, 0.4096, 1.6384, 6.5536] ``` Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io> * Use buckets with higher resolution Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io> --------- Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
1 parent 4a40eba commit 6debcdb

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

node/network/approval-distribution/src/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ impl MetricsTrait for Metrics {
134134
prometheus::Histogram::with_opts(prometheus::HistogramOpts::new(
135135
"polkadot_parachain_time_import_pending_now_known",
136136
"Time spent on importing pending assignments and approvals.",
137-
))?,
137+
).buckets(vec![0.0001, 0.0004, 0.0016, 0.0064, 0.0256, 0.1024, 0.4096, 1.6384, 3.2768, 4.9152, 6.5536,]))?,
138138
registry,
139139
)?,
140140
time_awaiting_approval_voting: prometheus::register(
141141
prometheus::Histogram::with_opts(prometheus::HistogramOpts::new(
142142
"polkadot_parachain_time_awaiting_approval_voting",
143143
"Time spent awaiting a reply from the Approval Voting Subsystem.",
144-
))?,
144+
).buckets(vec![0.0001, 0.0004, 0.0016, 0.0064, 0.0256, 0.1024, 0.4096, 1.6384, 3.2768, 4.9152, 6.5536,]))?,
145145
registry,
146146
)?,
147147
};

node/overseer/src/metrics.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ impl MetricsTrait for Metrics {
165165
prometheus::HistogramOpts::new(
166166
"polkadot_parachain_subsystem_bounded_tof",
167167
"Duration spent in a particular channel from entrance to removal",
168-
),
168+
)
169+
.buckets(vec![
170+
0.0001, 0.0004, 0.0016, 0.0064, 0.0256, 0.1024, 0.4096, 1.6384, 3.2768,
171+
4.9152, 6.5536,
172+
]),
169173
&["subsystem_name"],
170174
)?,
171175
registry,
@@ -205,7 +209,11 @@ impl MetricsTrait for Metrics {
205209
prometheus::HistogramOpts::new(
206210
"polkadot_parachain_subsystem_unbounded_tof",
207211
"Duration spent in a particular channel from entrance to removal",
208-
),
212+
)
213+
.buckets(vec![
214+
0.0001, 0.0004, 0.0016, 0.0064, 0.0256, 0.1024, 0.4096, 1.6384, 3.2768,
215+
4.9152, 6.5536,
216+
]),
209217
&["subsystem_name"],
210218
)?,
211219
registry,

0 commit comments

Comments
 (0)