diff --git a/polkadot/node/core/provisioner/src/lib.rs b/polkadot/node/core/provisioner/src/lib.rs index afbdf458746e974f7d1d94911ab18203b97bd1c1..bef9c64235247a3894a6c4c2d2095269149ad758 100644 --- a/polkadot/node/core/provisioner/src/lib.rs +++ b/polkadot/node/core/provisioner/src/lib.rs @@ -227,6 +227,7 @@ where leaf_hash = ?self.leaf.hash, "inherent data sent successfully" ); + self.metrics.observe_inherent_data_bitfields_count(self.signed_bitfields.len()); } } diff --git a/polkadot/node/core/provisioner/src/metrics.rs b/polkadot/node/core/provisioner/src/metrics.rs index bda0a560979de946d61c20a53f98ba6ee732f022..829293dfed536aa3d49b596d5c4e7dd12ee98f15 100644 --- a/polkadot/node/core/provisioner/src/metrics.rs +++ b/polkadot/node/core/provisioner/src/metrics.rs @@ -21,6 +21,7 @@ struct MetricsInner { inherent_data_requests: prometheus::CounterVec<prometheus::U64>, request_inherent_data: prometheus::Histogram, provisionable_data: prometheus::Histogram, + inherent_data_response_bitfields: prometheus::Histogram, /// The following metrics track how many disputes/votes the runtime will have to process. These will count /// all recent statements meaning every dispute from last sessions: 10 min on Rococo, 60 min on Kusama and @@ -63,6 +64,12 @@ impl Metrics { self.0.as_ref().map(|metrics| metrics.provisionable_data.start_timer()) } + pub(crate) fn observe_inherent_data_bitfields_count(&self, bitfields_count: usize) { + self.0.as_ref().map(|metrics| { + metrics.inherent_data_response_bitfields.observe(bitfields_count as f64) + }); + } + pub(crate) fn inc_valid_statements_by(&self, votes: usize) { if let Some(metrics) = &self.0 { metrics @@ -134,6 +141,15 @@ impl metrics::Metrics for Metrics { )?, registry, )?, + inherent_data_response_bitfields: prometheus::register( + prometheus::Histogram::with_opts( + prometheus::HistogramOpts::new( + "polkadot_parachain_provisioner_inherent_data_response_bitfields_sent", + "Number of inherent bitfields sent in response to `ProvisionerMessage::RequestInherentData`.", + ).buckets(vec![0.0, 10.0, 25.0, 50.0, 75.0, 100.0, 150.0, 200.0, 250.0, 300.0]), + )?, + registry, + )?, }; Ok(Metrics(Some(metrics))) }