referrerpolicy=no-referrer-when-downgrade

polkadot_node_metrics/runtime/
parachain.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// This file is part of Polkadot.
3
4// Polkadot is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Polkadot is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Polkadot.  If not, see <http://www.gnu.org/licenses/>.
16
17//! Client side declaration and registration of the parachain Prometheus metrics.
18//! All of the metrics have a correspondent runtime metric definition.
19
20use crate::runtime::RuntimeMetricsProvider;
21use polkadot_primitives::metric_definitions::{
22	PARACHAIN_CREATE_INHERENT_BITFIELDS_SIGNATURE_CHECKS,
23	PARACHAIN_INHERENT_DATA_BITFIELDS_PROCESSED, PARACHAIN_INHERENT_DATA_CANDIDATES_PROCESSED,
24	PARACHAIN_INHERENT_DATA_DISPUTE_SETS_PROCESSED, PARACHAIN_INHERENT_DATA_WEIGHT,
25	PARACHAIN_VERIFY_DISPUTE_SIGNATURE,
26};
27
28/// Register the parachain runtime metrics.
29pub fn register_metrics(runtime_metrics_provider: &RuntimeMetricsProvider) {
30	runtime_metrics_provider.register_counter(PARACHAIN_INHERENT_DATA_BITFIELDS_PROCESSED);
31
32	runtime_metrics_provider.register_countervec(PARACHAIN_INHERENT_DATA_WEIGHT);
33	runtime_metrics_provider.register_countervec(PARACHAIN_INHERENT_DATA_DISPUTE_SETS_PROCESSED);
34	runtime_metrics_provider.register_countervec(PARACHAIN_INHERENT_DATA_CANDIDATES_PROCESSED);
35	runtime_metrics_provider
36		.register_countervec(PARACHAIN_CREATE_INHERENT_BITFIELDS_SIGNATURE_CHECKS);
37	runtime_metrics_provider.register_histogram(PARACHAIN_VERIFY_DISPUTE_SIGNATURE);
38}