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:
Alexandru Vasile
2023-01-27 17:33:48 +02:00
committed by GitHub
parent 779c5698a0
commit b25f3fbf22
8 changed files with 65 additions and 21 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ pub struct NodeDetails {
}
/// Hardware and software information for the node.
#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub struct NodeSysInfo {
/// The exact CPU model.
pub cpu: Option<Box<str>>,
@@ -63,7 +63,7 @@ pub struct NodeSysInfo {
}
/// Hardware benchmark results for the node.
#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub struct NodeHwBench {
/// The CPU speed, as measured in how many MB/s it can hash using the BLAKE2b-256 hash.
pub cpu_hashrate_score: u64,