Skip to content
Snippets Groups Projects
Commit accc08c3 authored by Tsvetomir Dimitrov's avatar Tsvetomir Dimitrov Committed by GitHub
Browse files

Doc comments for metrics in provisioner (#5967)

parent b3480bd5
No related merge requests found
......@@ -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<prometheus::U64>,
request_inherent_data: prometheus::Histogram,
provisionable_data: prometheus::Histogram,
/// How much time the `RequestInherentData` processing takes
request_inherent_data_duration: prometheus::Histogram,
/// How much time `ProvisionableData` processing takes
provisionable_data_duration: prometheus::Histogram,
/// 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
......@@ -54,14 +58,16 @@ impl Metrics {
pub(crate) fn time_request_inherent_data(
&self,
) -> Option<metrics::prometheus::prometheus::HistogramTimer> {
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<metrics::prometheus::prometheus::HistogramTimer> {
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) {
......@@ -110,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`",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment