mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 00:45:43 +00:00
add a metric for report events in network bridge (#5160)
This commit is contained in:
@@ -143,6 +143,12 @@ impl Metrics {
|
|||||||
.set(size as u64)
|
.set(size as u64)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn on_report_event(&self) {
|
||||||
|
if let Some(metrics) = self.0.as_ref() {
|
||||||
|
metrics.report_events.inc()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@@ -151,6 +157,7 @@ struct MetricsInner {
|
|||||||
connected_events: prometheus::CounterVec<prometheus::U64>,
|
connected_events: prometheus::CounterVec<prometheus::U64>,
|
||||||
disconnected_events: prometheus::CounterVec<prometheus::U64>,
|
disconnected_events: prometheus::CounterVec<prometheus::U64>,
|
||||||
desired_peer_count: prometheus::GaugeVec<prometheus::U64>,
|
desired_peer_count: prometheus::GaugeVec<prometheus::U64>,
|
||||||
|
report_events: prometheus::Counter<prometheus::U64>,
|
||||||
|
|
||||||
notifications_received: prometheus::CounterVec<prometheus::U64>,
|
notifications_received: prometheus::CounterVec<prometheus::U64>,
|
||||||
notifications_sent: prometheus::CounterVec<prometheus::U64>,
|
notifications_sent: prometheus::CounterVec<prometheus::U64>,
|
||||||
@@ -204,6 +211,13 @@ impl metrics::Metrics for Metrics {
|
|||||||
)?,
|
)?,
|
||||||
registry,
|
registry,
|
||||||
)?,
|
)?,
|
||||||
|
report_events: prometheus::register(
|
||||||
|
prometheus::Counter::new(
|
||||||
|
"polkadot_parachain_network_report_events_total",
|
||||||
|
"The amount of reputation changes issued by subsystems",
|
||||||
|
)?,
|
||||||
|
registry,
|
||||||
|
)?,
|
||||||
notifications_received: prometheus::register(
|
notifications_received: prometheus::register(
|
||||||
prometheus::CounterVec::new(
|
prometheus::CounterVec::new(
|
||||||
prometheus::Opts::new(
|
prometheus::Opts::new(
|
||||||
@@ -438,6 +452,8 @@ where
|
|||||||
action = "ReportPeer"
|
action = "ReportPeer"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
metrics.on_report_event();
|
||||||
network_service.report_peer(peer, rep);
|
network_service.report_peer(peer, rep);
|
||||||
}
|
}
|
||||||
NetworkBridgeMessage::DisconnectPeer(peer, peer_set) => {
|
NetworkBridgeMessage::DisconnectPeer(peer, peer_set) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user