mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-04-22 10:18:03 +00:00
Cut metrics (#280)
This commit is contained in:
@@ -288,7 +288,7 @@ impl Handler<Connect> for Aggregator {
|
||||
|
||||
connector.do_send(Connected(fid));
|
||||
|
||||
self.serializer.push(feed::Version(29));
|
||||
self.serializer.push(feed::Version(30));
|
||||
|
||||
// TODO: keep track on number of nodes connected to each chain
|
||||
for (_, entry) in self.chains.iter() {
|
||||
|
||||
@@ -130,12 +130,6 @@ impl Node {
|
||||
pub fn update_hardware(&mut self, interval: &SystemInterval) -> bool {
|
||||
let mut changed = false;
|
||||
|
||||
if let Some(cpu) = interval.cpu {
|
||||
changed |= self.hardware.cpu.push(cpu);
|
||||
}
|
||||
if let Some(memory) = interval.memory {
|
||||
changed |= self.hardware.memory.push(memory);
|
||||
}
|
||||
if let Some(upload) = interval.bandwidth_upload {
|
||||
changed |= self.hardware.upload.push(upload);
|
||||
}
|
||||
@@ -162,15 +156,6 @@ impl Node {
|
||||
if let Some(size) = interval.used_state_cache_size {
|
||||
changed |= self.io.used_state_cache_size.push(size);
|
||||
}
|
||||
if let Some(size) = interval.used_db_cache_size {
|
||||
changed |= self.io.used_db_cache_size.push(size);
|
||||
}
|
||||
if let Some(bps) = interval.disk_read_per_sec {
|
||||
changed |= self.io.disk_read_per_sec.push(bps);
|
||||
}
|
||||
if let Some(bps) = interval.disk_write_per_sec {
|
||||
changed |= self.io.disk_write_per_sec.push(bps);
|
||||
}
|
||||
|
||||
if changed {
|
||||
Some(&self.io)
|
||||
|
||||
@@ -65,8 +65,6 @@ pub struct SystemConnected {
|
||||
pub struct SystemInterval {
|
||||
#[serde(flatten)]
|
||||
pub stats: NodeStats,
|
||||
pub memory: Option<f32>,
|
||||
pub cpu: Option<f32>,
|
||||
pub bandwidth_upload: Option<f64>,
|
||||
pub bandwidth_download: Option<f64>,
|
||||
pub finalized_height: Option<BlockNumber>,
|
||||
@@ -75,9 +73,6 @@ pub struct SystemInterval {
|
||||
pub block: Block,
|
||||
pub network_state: Option<IgnoredAny>,
|
||||
pub used_state_cache_size: Option<f32>,
|
||||
pub used_db_cache_size: Option<f32>,
|
||||
pub disk_read_per_sec: Option<f32>,
|
||||
pub disk_write_per_sec: Option<f32>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
|
||||
+2
-14
@@ -28,9 +28,6 @@ pub struct NodeStats {
|
||||
#[derive(Default)]
|
||||
pub struct NodeIO {
|
||||
pub used_state_cache_size: MeanList<f32>,
|
||||
pub used_db_cache_size: MeanList<f32>,
|
||||
pub disk_read_per_sec: MeanList<f32>,
|
||||
pub disk_write_per_sec: MeanList<f32>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug, Clone, Copy)]
|
||||
@@ -61,10 +58,6 @@ impl Default for BlockDetails {
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct NodeHardware {
|
||||
/// CPU use means
|
||||
pub cpu: MeanList<f32>,
|
||||
/// Memory use means
|
||||
pub memory: MeanList<f32>,
|
||||
/// Upload uses means
|
||||
pub upload: MeanList<f64>,
|
||||
/// Download uses means
|
||||
@@ -112,11 +105,8 @@ impl Serialize for NodeIO {
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
let mut tup = serializer.serialize_tuple(4)?;
|
||||
let mut tup = serializer.serialize_tuple(1)?;
|
||||
tup.serialize_element(self.used_state_cache_size.slice())?;
|
||||
tup.serialize_element(self.used_db_cache_size.slice())?;
|
||||
tup.serialize_element(self.disk_read_per_sec.slice())?;
|
||||
tup.serialize_element(self.disk_write_per_sec.slice())?;
|
||||
tup.end()
|
||||
}
|
||||
}
|
||||
@@ -154,9 +144,7 @@ impl Serialize for NodeHardware {
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
let mut tup = serializer.serialize_tuple(5)?;
|
||||
tup.serialize_element(self.memory.slice())?;
|
||||
tup.serialize_element(self.cpu.slice())?;
|
||||
let mut tup = serializer.serialize_tuple(3)?;
|
||||
tup.serialize_element(self.upload.slice())?;
|
||||
tup.serialize_element(self.download.slice())?;
|
||||
tup.serialize_element(self.chart_stamps.slice())?;
|
||||
|
||||
@@ -294,10 +294,7 @@ export class Connection {
|
||||
nodes.mutAndMaybeSort(
|
||||
id,
|
||||
(node) => node.updateHardware(nodeHardware),
|
||||
sortByColumn === Column.CPU ||
|
||||
sortByColumn === Column.MEM ||
|
||||
sortByColumn === Column.UPLOAD ||
|
||||
sortByColumn === Column.DOWNLOAD
|
||||
sortByColumn === Column.UPLOAD || sortByColumn === Column.DOWNLOAD
|
||||
);
|
||||
|
||||
break;
|
||||
@@ -309,10 +306,7 @@ export class Connection {
|
||||
nodes.mutAndMaybeSort(
|
||||
id,
|
||||
(node) => node.updateIO(nodeIO),
|
||||
sortByColumn === Column.STATE_CACHE ||
|
||||
sortByColumn === Column.DB_CACHE ||
|
||||
sortByColumn === Column.DISK_READ ||
|
||||
sortByColumn === Column.DISK_WRITE
|
||||
sortByColumn === Column.STATE_CACHE
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
@@ -9,4 +9,4 @@ import * as FeedMessage from './feed';
|
||||
export { Types, FeedMessage };
|
||||
|
||||
// Increment this if breaking changes were made to types in `feed.ts`
|
||||
export const VERSION: Types.FeedVersion = 29 as Types.FeedVersion;
|
||||
export const VERSION: Types.FeedVersion = 30 as Types.FeedVersion;
|
||||
|
||||
@@ -42,15 +42,8 @@ export type NodeDetails = [
|
||||
Maybe<NetworkId>
|
||||
];
|
||||
export type NodeStats = [PeerCount, TransactionCount];
|
||||
export type NodeIO = [
|
||||
Array<Bytes>,
|
||||
Array<Bytes>,
|
||||
Array<BytesPerSecond>,
|
||||
Array<BytesPerSecond>
|
||||
];
|
||||
export type NodeIO = [Array<Bytes>];
|
||||
export type NodeHardware = [
|
||||
Array<MemoryUse>,
|
||||
Array<CPUUse>,
|
||||
Array<BytesPerSecond>,
|
||||
Array<BytesPerSecond>,
|
||||
Array<Timestamp>
|
||||
|
||||
@@ -32,13 +32,8 @@ import blockHashIcon from '../../icons/file-binary.svg';
|
||||
import blockTimeIcon from '../../icons/history.svg';
|
||||
import propagationTimeIcon from '../../icons/dashboard.svg';
|
||||
import lastTimeIcon from '../../icons/watch.svg';
|
||||
import cpuIcon from '../../icons/microchip-solid.svg';
|
||||
import memoryIcon from '../../icons/memory-solid.svg';
|
||||
import uploadIcon from '../../icons/cloud-upload.svg';
|
||||
import downloadIcon from '../../icons/cloud-download.svg';
|
||||
import readIcon from '../../icons/arrow-up.svg';
|
||||
import writeIcon from '../../icons/arrow-down.svg';
|
||||
import databaseIcon from '../../icons/database.svg';
|
||||
import stateIcon from '../../icons/git-branch.svg';
|
||||
import networkIcon from '../../icons/network.svg';
|
||||
import uptimeIcon from '../../icons/pulse.svg';
|
||||
@@ -171,56 +166,6 @@ export namespace Column {
|
||||
render: ({ txs }) => `${txs}`,
|
||||
};
|
||||
|
||||
export const CPU: Column = {
|
||||
label: '% CPU Use',
|
||||
icon: cpuIcon,
|
||||
width: 40,
|
||||
setting: 'cpu',
|
||||
sortBy: ({ cpu }) => (cpu.length < 3 ? 0 : cpu[cpu.length - 1]),
|
||||
render: ({ cpu, chartstamps }) => {
|
||||
if (cpu.length < 3) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return (
|
||||
<Sparkline
|
||||
width={44}
|
||||
height={16}
|
||||
stroke={1}
|
||||
format={formatCPU}
|
||||
values={cpu}
|
||||
stamps={chartstamps}
|
||||
minScale={100}
|
||||
/>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const MEM: Column = {
|
||||
label: 'Memory Use',
|
||||
icon: memoryIcon,
|
||||
width: 40,
|
||||
setting: 'mem',
|
||||
sortBy: ({ mem }) => (mem.length < 3 ? 0 : mem[mem.length - 1]),
|
||||
render: ({ mem, chartstamps }) => {
|
||||
if (mem.length < 3) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return (
|
||||
<Sparkline
|
||||
width={44}
|
||||
height={16}
|
||||
stroke={1}
|
||||
format={formatMemory}
|
||||
values={mem}
|
||||
stamps={chartstamps}
|
||||
minScale={MEMORY_SCALE}
|
||||
/>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const UPLOAD: Column = {
|
||||
label: 'Upload Bandwidth',
|
||||
icon: uploadIcon,
|
||||
@@ -298,84 +243,6 @@ export namespace Column {
|
||||
},
|
||||
};
|
||||
|
||||
export const DB_CACHE: Column = {
|
||||
label: 'Database Cache Size',
|
||||
icon: databaseIcon,
|
||||
width: 40,
|
||||
setting: 'dbCacheSize',
|
||||
sortBy: ({ dbCacheSize }) =>
|
||||
dbCacheSize.length < 3 ? 0 : dbCacheSize[dbCacheSize.length - 1],
|
||||
render: ({ dbCacheSize, chartstamps }) => {
|
||||
if (dbCacheSize.length < 3) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return (
|
||||
<Sparkline
|
||||
width={44}
|
||||
height={16}
|
||||
stroke={1}
|
||||
format={formatBytes}
|
||||
values={dbCacheSize}
|
||||
stamps={chartstamps}
|
||||
minScale={MEMORY_SCALE}
|
||||
/>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const DISK_READ: Column = {
|
||||
label: 'Disk Read',
|
||||
icon: readIcon,
|
||||
width: 40,
|
||||
setting: 'diskRead',
|
||||
sortBy: ({ diskRead }) =>
|
||||
diskRead.length < 3 ? 0 : diskRead[diskRead.length - 1],
|
||||
render: ({ diskRead, chartstamps }) => {
|
||||
if (diskRead.length < 3) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return (
|
||||
<Sparkline
|
||||
width={44}
|
||||
height={16}
|
||||
stroke={1}
|
||||
format={formatBandwidth}
|
||||
values={diskRead}
|
||||
stamps={chartstamps}
|
||||
minScale={MEMORY_SCALE}
|
||||
/>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const DISK_WRITE: Column = {
|
||||
label: 'Disk Write',
|
||||
icon: writeIcon,
|
||||
width: 40,
|
||||
setting: 'diskWrite',
|
||||
sortBy: ({ diskWrite }) =>
|
||||
diskWrite.length < 3 ? 0 : diskWrite[diskWrite.length - 1],
|
||||
render: ({ diskWrite, chartstamps }) => {
|
||||
if (diskWrite.length < 3) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return (
|
||||
<Sparkline
|
||||
width={44}
|
||||
height={16}
|
||||
stroke={1}
|
||||
format={formatBandwidth}
|
||||
values={diskWrite}
|
||||
stamps={chartstamps}
|
||||
minScale={MEMORY_SCALE}
|
||||
/>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const BLOCK_NUMBER: Column = {
|
||||
label: 'Block',
|
||||
icon: blockIcon,
|
||||
|
||||
@@ -32,14 +32,9 @@ export class Row extends React.Component<Row.Props, Row.State> {
|
||||
Column.NETWORK_ID,
|
||||
Column.PEERS,
|
||||
Column.TXS,
|
||||
Column.CPU,
|
||||
Column.MEM,
|
||||
Column.UPLOAD,
|
||||
Column.DOWNLOAD,
|
||||
Column.STATE_CACHE,
|
||||
Column.DB_CACHE,
|
||||
Column.DISK_READ,
|
||||
Column.DISK_WRITE,
|
||||
Column.BLOCK_NUMBER,
|
||||
Column.BLOCK_HASH,
|
||||
Column.FINALIZED,
|
||||
|
||||
+2
-17
@@ -51,14 +51,9 @@ export class Node {
|
||||
public pinned: boolean;
|
||||
public peers: Types.PeerCount;
|
||||
public txs: Types.TransactionCount;
|
||||
public mem: Types.MemoryUse[];
|
||||
public cpu: Types.CPUUse[];
|
||||
public upload: Types.BytesPerSecond[];
|
||||
public download: Types.BytesPerSecond[];
|
||||
public stateCacheSize: Types.Bytes[];
|
||||
public dbCacheSize: Types.Bytes[];
|
||||
public diskRead: Types.BytesPerSecond[];
|
||||
public diskWrite: Types.BytesPerSecond[];
|
||||
public chartstamps: Types.Timestamp[];
|
||||
|
||||
public height: Types.BlockNumber;
|
||||
@@ -127,21 +122,16 @@ export class Node {
|
||||
}
|
||||
|
||||
public updateIO(io: Types.NodeIO) {
|
||||
const [stateCacheSize, dbCacheSize, diskRead, diskWrite] = io;
|
||||
const [stateCacheSize] = io;
|
||||
|
||||
this.stateCacheSize = stateCacheSize;
|
||||
this.dbCacheSize = dbCacheSize;
|
||||
this.diskRead = diskRead;
|
||||
this.diskWrite = diskWrite;
|
||||
|
||||
this.trigger();
|
||||
}
|
||||
|
||||
public updateHardware(hardware: Types.NodeHardware) {
|
||||
const [mem, cpu, upload, download, chartstamps] = hardware;
|
||||
const [upload, download, chartstamps] = hardware;
|
||||
|
||||
this.mem = mem;
|
||||
this.cpu = cpu;
|
||||
this.upload = upload;
|
||||
this.download = download;
|
||||
this.chartstamps = chartstamps;
|
||||
@@ -229,14 +219,9 @@ export namespace State {
|
||||
networkId: boolean;
|
||||
peers: boolean;
|
||||
txs: boolean;
|
||||
cpu: boolean;
|
||||
mem: boolean;
|
||||
upload: boolean;
|
||||
download: boolean;
|
||||
stateCacheSize: boolean;
|
||||
dbCacheSize: boolean;
|
||||
diskRead: boolean;
|
||||
diskWrite: boolean;
|
||||
blocknumber: boolean;
|
||||
blockhash: boolean;
|
||||
finalized: boolean;
|
||||
|
||||
Reference in New Issue
Block a user