mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 08:27:55 +00:00
Adjustments to Kademlia-related metrics (#5660)
* Turn kbuckets_num_nodes into a GaugeVec * random_kademlia_queries -> kademlia_random_queries * kademalia_random_queries_total now a CounterVec * Add metrics about records store
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
//!
|
||||
|
||||
use crate::Event;
|
||||
use super::engine_id_to_string;
|
||||
use super::maybe_utf8_bytes_to_string;
|
||||
|
||||
use futures::{prelude::*, channel::mpsc, ready};
|
||||
use parking_lot::Mutex;
|
||||
@@ -240,7 +240,7 @@ impl Metrics {
|
||||
.with_label_values(&[&format!("notif-{:?}", engine_id), "sent", name])
|
||||
.inc_by(num);
|
||||
self.notifications_sizes
|
||||
.with_label_values(&[&engine_id_to_string(engine_id), "sent", name])
|
||||
.with_label_values(&[&maybe_utf8_bytes_to_string(engine_id), "sent", name])
|
||||
.inc_by(num.saturating_mul(u64::try_from(message.len()).unwrap_or(u64::max_value())));
|
||||
}
|
||||
},
|
||||
@@ -270,7 +270,7 @@ impl Metrics {
|
||||
.with_label_values(&[&format!("notif-{:?}", engine_id), "received", name])
|
||||
.inc();
|
||||
self.notifications_sizes
|
||||
.with_label_values(&[&engine_id_to_string(engine_id), "received", name])
|
||||
.with_label_values(&[&maybe_utf8_bytes_to_string(engine_id), "received", name])
|
||||
.inc_by(u64::try_from(message.len()).unwrap_or(u64::max_value()));
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user