mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-04-23 06:08:04 +00:00
Add per Node Hardware Information to Telemetry Feed (#519)
* code: Add `sysinfo` and `hwbench` to the `AddedNode` message Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * code: Update `AddedNode` on `hwbench` updates Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * core: Rename cli flag `expose_node_ips` to `expose_node_details` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * core: Add hardware info only if the cli flag is enabled Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Adjust testing to the new `AddedNode` message Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * core: Move serialization of fields to the details array Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
|
||||
use anyhow::Context;
|
||||
use common::node_types::{
|
||||
BlockDetails, BlockHash, BlockNumber, NodeLocation, NodeStats, Timestamp,
|
||||
BlockDetails, BlockHash, BlockNumber, NodeHwBench, NodeLocation, NodeStats, NodeSysInfo,
|
||||
Timestamp,
|
||||
};
|
||||
use serde_json::value::RawValue;
|
||||
|
||||
@@ -41,6 +42,7 @@ pub enum FeedMessage {
|
||||
block_details: BlockDetails,
|
||||
location: Option<NodeLocation>,
|
||||
startup_time: Option<Timestamp>,
|
||||
hwbench: Option<NodeHwBench>,
|
||||
},
|
||||
RemovedNode {
|
||||
node_id: usize,
|
||||
@@ -135,6 +137,7 @@ pub struct NodeDetails {
|
||||
pub validator: Option<String>,
|
||||
pub network_id: Option<String>,
|
||||
pub ip: Option<String>,
|
||||
pub sysinfo: Option<NodeSysInfo>,
|
||||
}
|
||||
|
||||
impl FeedMessage {
|
||||
@@ -186,7 +189,7 @@ impl FeedMessage {
|
||||
3 => {
|
||||
let (
|
||||
node_id,
|
||||
(name, implementation, version, validator, network_id, ip),
|
||||
(name, implementation, version, validator, network_id, ip, sysinfo, hwbench),
|
||||
stats,
|
||||
io,
|
||||
hardware,
|
||||
@@ -207,11 +210,13 @@ impl FeedMessage {
|
||||
validator,
|
||||
network_id,
|
||||
ip,
|
||||
sysinfo,
|
||||
},
|
||||
stats,
|
||||
block_details,
|
||||
location,
|
||||
startup_time,
|
||||
hwbench,
|
||||
}
|
||||
}
|
||||
// RemoveNode
|
||||
|
||||
Reference in New Issue
Block a user