mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-14 14:11:02 +00:00
Feat: Map Node Stats (Version, Operating System etc) to each Node in Feed (#591)
* added functionality for specifying node details per each node * Backend done Added new item in Ranking node_map, mapping node id to node detail Co-authored-by: Cyndie Kamau <cyndiekamaa@gmail.com> * feat: last frontend working version * chore: Clean up unused code * fix(frontend): update node details to carry 10 fields * chore: remove unnecessary code * chore: run cargo fmt for formatting * chore: run prettier to format frontend * fixed e2e tests added missing struct params * remoted .idea file * Hide new columns by default, default to - if no data, and remove .idea folder --------- Co-authored-by: MrishoLukamba <abdulrazzaqlukamba@gmail.com> Co-authored-by: Cyndie Kamau <cyndiekamaa@gmail.com>
This commit is contained in:
@@ -69,7 +69,7 @@ pub enum FromShardWebsocket {
|
||||
Disconnected,
|
||||
}
|
||||
|
||||
/// The aggregator can these messages back to a shard connection.
|
||||
/// The aggregator can send these messages back to a shard connection.
|
||||
#[derive(Debug)]
|
||||
pub enum ToShardWebsocket {
|
||||
/// Mute messages to the core by passing the shard-local ID of them.
|
||||
@@ -84,7 +84,7 @@ pub enum ToShardWebsocket {
|
||||
pub enum FromFeedWebsocket {
|
||||
/// When the socket is opened, it'll send this first
|
||||
/// so that we have a way to communicate back to it.
|
||||
/// Unbounded so that slow feeds don't block aggregato
|
||||
/// Unbounded so that slow feeds don't block aggregator
|
||||
/// progress.
|
||||
Initialize {
|
||||
channel: flume::Sender<ToFeedWebsocket>,
|
||||
|
||||
@@ -183,12 +183,18 @@ impl FeedMessageWrite for AddedNode<'_> {
|
||||
let AddedNode(nid, node, expose_node_details) = self;
|
||||
|
||||
let details = node.details();
|
||||
// Hide the ip, sysinfo and hwbench if the `expose_node_details` flag was not specified.
|
||||
// Always include sysinfo, conditionally include ip and hwbench based on expose_node_details.
|
||||
let node_hwbench = node.hwbench();
|
||||
let (ip, sys_info, hwbench) = if *expose_node_details {
|
||||
(&details.ip, &details.sysinfo, &node_hwbench)
|
||||
let ip = if *expose_node_details {
|
||||
&details.ip
|
||||
} else {
|
||||
(&None, &None, &None)
|
||||
&None
|
||||
};
|
||||
let sys_info = &details.sysinfo;
|
||||
let hwbench = if *expose_node_details {
|
||||
&node_hwbench
|
||||
} else {
|
||||
&None
|
||||
};
|
||||
|
||||
let details = (
|
||||
@@ -197,6 +203,9 @@ impl FeedMessageWrite for AddedNode<'_> {
|
||||
&details.version,
|
||||
&details.validator,
|
||||
&details.network_id,
|
||||
&details.target_os,
|
||||
&details.target_arch,
|
||||
&details.target_env,
|
||||
&ip,
|
||||
&sys_info,
|
||||
&hwbench,
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
use super::counter::{Counter, CounterValue};
|
||||
use crate::feed_message::ChainStats;
|
||||
|
||||
// These are the benchmark scores generated on our reference hardware.
|
||||
const REFERENCE_CPU_SCORE: u64 = 1028;
|
||||
const REFERENCE_MEMORY_SCORE: u64 = 14899;
|
||||
|
||||
@@ -39,7 +39,7 @@ impl<K> Counter<K>
|
||||
where
|
||||
K: Sized + std::hash::Hash + Eq,
|
||||
{
|
||||
/// Either adds or removes a single occurrence of a given `key`.
|
||||
/// Either adds or removes a single occurence of a given `key`.
|
||||
pub fn modify<'a, Q>(&mut self, key: Option<&'a Q>, op: CounterValue)
|
||||
where
|
||||
Q: ?Sized + std::hash::Hash + Eq,
|
||||
|
||||
Reference in New Issue
Block a user