From bfa7229d96038c202191daea24b14521d08c7c27 Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Mon, 5 Sep 2022 10:22:57 +0300 Subject: [PATCH 1/3] Doc comments for metrics in provisioner --- node/core/provisioner/src/metrics.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node/core/provisioner/src/metrics.rs b/node/core/provisioner/src/metrics.rs index 829293dfed53..07b9246be210 100644 --- a/node/core/provisioner/src/metrics.rs +++ b/node/core/provisioner/src/metrics.rs @@ -18,9 +18,13 @@ use polkadot_node_subsystem_util::metrics::{self, prometheus}; #[derive(Clone)] struct MetricsInner { + /// Tracks successful/unsuccessful inherent data requests inherent_data_requests: prometheus::CounterVec, + /// How much time the `RequestInherentData` processing takes request_inherent_data: prometheus::Histogram, + /// How much time `ProvisionableData` processing takes provisionable_data: prometheus::Histogram, + /// Bitfileds array length in `ProvisionerInherentData` (the result for `RequestInherentData`) inherent_data_response_bitfields: prometheus::Histogram, /// The following metrics track how many disputes/votes the runtime will have to process. These will count From 086a1398e9dba00e9e93bd7505c70080e85ccccc Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Mon, 5 Sep 2022 13:59:11 +0300 Subject: [PATCH 2/3] Rename metrics --- node/core/provisioner/src/metrics.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/node/core/provisioner/src/metrics.rs b/node/core/provisioner/src/metrics.rs index 07b9246be210..6da2769216cd 100644 --- a/node/core/provisioner/src/metrics.rs +++ b/node/core/provisioner/src/metrics.rs @@ -21,9 +21,9 @@ struct MetricsInner { /// Tracks successful/unsuccessful inherent data requests inherent_data_requests: prometheus::CounterVec, /// How much time the `RequestInherentData` processing takes - request_inherent_data: prometheus::Histogram, + request_inherent_data_duration: prometheus::Histogram, /// How much time `ProvisionableData` processing takes - provisionable_data: prometheus::Histogram, + provisionable_data_duration: prometheus::Histogram, /// Bitfileds array length in `ProvisionerInherentData` (the result for `RequestInherentData`) inherent_data_response_bitfields: prometheus::Histogram, @@ -58,14 +58,16 @@ impl Metrics { pub(crate) fn time_request_inherent_data( &self, ) -> Option { - self.0.as_ref().map(|metrics| metrics.request_inherent_data.start_timer()) + self.0 + .as_ref() + .map(|metrics| metrics.request_inherent_data_duration.start_timer()) } /// Provide a timer for `provisionable_data` which observes on drop. pub(crate) fn time_provisionable_data( &self, ) -> Option { - self.0.as_ref().map(|metrics| metrics.provisionable_data.start_timer()) + self.0.as_ref().map(|metrics| metrics.provisionable_data_duration.start_timer()) } pub(crate) fn observe_inherent_data_bitfields_count(&self, bitfields_count: usize) { @@ -114,14 +116,14 @@ impl metrics::Metrics for Metrics { )?, registry, )?, - request_inherent_data: prometheus::register( + request_inherent_data_duration: prometheus::register( prometheus::Histogram::with_opts(prometheus::HistogramOpts::new( "polkadot_parachain_provisioner_request_inherent_data_time", "Time spent within `provisioner::request_inherent_data`", ))?, registry, )?, - provisionable_data: prometheus::register( + provisionable_data_duration: prometheus::register( prometheus::Histogram::with_opts(prometheus::HistogramOpts::new( "polkadot_parachain_provisioner_provisionable_data_time", "Time spent within `provisioner::provisionable_data`", From bc6713d64039e8d9790c573ae50641289d0869e6 Mon Sep 17 00:00:00 2001 From: Tsvetomir Dimitrov Date: Mon, 5 Sep 2022 15:02:41 +0300 Subject: [PATCH 3/3] Spelling --- node/core/provisioner/src/metrics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/core/provisioner/src/metrics.rs b/node/core/provisioner/src/metrics.rs index 6da2769216cd..508c668f6e24 100644 --- a/node/core/provisioner/src/metrics.rs +++ b/node/core/provisioner/src/metrics.rs @@ -24,7 +24,7 @@ struct MetricsInner { request_inherent_data_duration: prometheus::Histogram, /// How much time `ProvisionableData` processing takes provisionable_data_duration: prometheus::Histogram, - /// Bitfileds array length in `ProvisionerInherentData` (the result for `RequestInherentData`) + /// Bitfields array length in `ProvisionerInherentData` (the result for `RequestInherentData`) inherent_data_response_bitfields: prometheus::Histogram, /// The following metrics track how many disputes/votes the runtime will have to process. These will count