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

Commit

Permalink
metrics: Increase the resolution of histogram metrics (#7335)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
alexggh authored Jun 8, 2023
1 parent 4a40eba commit 6debcdb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions node/network/approval-distribution/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ impl MetricsTrait for Metrics {
prometheus::Histogram::with_opts(prometheus::HistogramOpts::new(
"polkadot_parachain_time_import_pending_now_known",
"Time spent on importing pending assignments and approvals.",
))?,
).buckets(vec![0.0001, 0.0004, 0.0016, 0.0064, 0.0256, 0.1024, 0.4096, 1.6384, 3.2768, 4.9152, 6.5536,]))?,
registry,
)?,
time_awaiting_approval_voting: prometheus::register(
prometheus::Histogram::with_opts(prometheus::HistogramOpts::new(
"polkadot_parachain_time_awaiting_approval_voting",
"Time spent awaiting a reply from the Approval Voting Subsystem.",
))?,
).buckets(vec![0.0001, 0.0004, 0.0016, 0.0064, 0.0256, 0.1024, 0.4096, 1.6384, 3.2768, 4.9152, 6.5536,]))?,
registry,
)?,
};
Expand Down
12 changes: 10 additions & 2 deletions node/overseer/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ impl MetricsTrait for Metrics {
prometheus::HistogramOpts::new(
"polkadot_parachain_subsystem_bounded_tof",
"Duration spent in a particular channel from entrance to removal",
),
)
.buckets(vec![
0.0001, 0.0004, 0.0016, 0.0064, 0.0256, 0.1024, 0.4096, 1.6384, 3.2768,
4.9152, 6.5536,
]),
&["subsystem_name"],
)?,
registry,
Expand Down Expand Up @@ -205,7 +209,11 @@ impl MetricsTrait for Metrics {
prometheus::HistogramOpts::new(
"polkadot_parachain_subsystem_unbounded_tof",
"Duration spent in a particular channel from entrance to removal",
),
)
.buckets(vec![
0.0001, 0.0004, 0.0016, 0.0064, 0.0256, 0.1024, 0.4096, 1.6384, 3.2768,
4.9152, 6.5536,
]),
&["subsystem_name"],
)?,
registry,
Expand Down

0 comments on commit 6debcdb

Please sign in to comment.