From 6653ac5afd1a3c9eebac262275092609b903bb9a Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 25 Nov 2022 16:14:29 +0000 Subject: [PATCH 1/4] Add buckets below 5ms --- node/core/av-store/src/metrics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/core/av-store/src/metrics.rs b/node/core/av-store/src/metrics.rs index c50932c6173e..b7ad0cab2f81 100644 --- a/node/core/av-store/src/metrics.rs +++ b/node/core/av-store/src/metrics.rs @@ -143,7 +143,7 @@ impl metrics::Metrics for Metrics { prometheus::Histogram::with_opts(prometheus::HistogramOpts::new( "polkadot_parachain_av_store_get_chunk", "Time spent fetching requested chunks.`", - ))?, + ).buckets(vec![0.000625, 0.00125,0.0025, 0.005, 0.0075, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0,]))?, registry, )?, }; From a796594ba26c924e6503b98c52fc810d53398906 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 25 Nov 2022 16:33:31 +0000 Subject: [PATCH 2/4] Add more specific histogram buckets --- node/network/approval-distribution/src/metrics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/network/approval-distribution/src/metrics.rs b/node/network/approval-distribution/src/metrics.rs index c0887b25f7f4..b14e54c57403 100644 --- a/node/network/approval-distribution/src/metrics.rs +++ b/node/network/approval-distribution/src/metrics.rs @@ -127,7 +127,7 @@ impl MetricsTrait for Metrics { prometheus::Histogram::with_opts(prometheus::HistogramOpts::new( "polkadot_parachain_time_unify_with_peer", "Time spent within fn `unify_with_peer`.", - ))?, + ).buckets(vec![0.000625, 0.00125,0.0025, 0.005, 0.0075, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0,]))?, registry, )?, time_import_pending_now_known: prometheus::register( From bc8be2c21abcd9689afecfb6b02413f801556d84 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 25 Nov 2022 16:33:43 +0000 Subject: [PATCH 3/4] Add more specific buckets --- node/core/bitfield-signing/src/metrics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/core/bitfield-signing/src/metrics.rs b/node/core/bitfield-signing/src/metrics.rs index ab4e73be0eeb..eca0d49642da 100644 --- a/node/core/bitfield-signing/src/metrics.rs +++ b/node/core/bitfield-signing/src/metrics.rs @@ -53,7 +53,7 @@ impl metrics::Metrics for Metrics { prometheus::Histogram::with_opts(prometheus::HistogramOpts::new( "polkadot_parachain_bitfield_signing_run", "Time spent within `bitfield_signing::run`", - ))?, + ).buckets(vec![0.000625, 0.00125,0.0025, 0.005, 0.0075, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0,]))?, registry, )?, }; From a4b19f7ed145ad4abbe88789a3116ad73f9b8807 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 25 Nov 2022 16:46:11 +0000 Subject: [PATCH 4/4] cargo fmt --- node/core/av-store/src/metrics.rs | 14 ++++++++++---- node/core/bitfield-signing/src/metrics.rs | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/node/core/av-store/src/metrics.rs b/node/core/av-store/src/metrics.rs index b7ad0cab2f81..fedeb2b7d0e5 100644 --- a/node/core/av-store/src/metrics.rs +++ b/node/core/av-store/src/metrics.rs @@ -140,10 +140,16 @@ impl metrics::Metrics for Metrics { registry, )?, get_chunk: prometheus::register( - prometheus::Histogram::with_opts(prometheus::HistogramOpts::new( - "polkadot_parachain_av_store_get_chunk", - "Time spent fetching requested chunks.`", - ).buckets(vec![0.000625, 0.00125,0.0025, 0.005, 0.0075, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0,]))?, + prometheus::Histogram::with_opts( + prometheus::HistogramOpts::new( + "polkadot_parachain_av_store_get_chunk", + "Time spent fetching requested chunks.`", + ) + .buckets(vec![ + 0.000625, 0.00125, 0.0025, 0.005, 0.0075, 0.01, 0.025, 0.05, 0.1, 0.25, + 0.5, 1.0, 2.5, 5.0, 10.0, + ]), + )?, registry, )?, }; diff --git a/node/core/bitfield-signing/src/metrics.rs b/node/core/bitfield-signing/src/metrics.rs index eca0d49642da..571a0c335bd7 100644 --- a/node/core/bitfield-signing/src/metrics.rs +++ b/node/core/bitfield-signing/src/metrics.rs @@ -50,10 +50,16 @@ impl metrics::Metrics for Metrics { registry, )?, run: prometheus::register( - prometheus::Histogram::with_opts(prometheus::HistogramOpts::new( - "polkadot_parachain_bitfield_signing_run", - "Time spent within `bitfield_signing::run`", - ).buckets(vec![0.000625, 0.00125,0.0025, 0.005, 0.0075, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0,]))?, + prometheus::Histogram::with_opts( + prometheus::HistogramOpts::new( + "polkadot_parachain_bitfield_signing_run", + "Time spent within `bitfield_signing::run`", + ) + .buckets(vec![ + 0.000625, 0.00125, 0.0025, 0.005, 0.0075, 0.01, 0.025, 0.05, 0.1, 0.25, + 0.5, 1.0, 2.5, 5.0, 10.0, + ]), + )?, registry, )?, };