mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-04-23 06:08:04 +00:00
Cut metrics (#280)
This commit is contained in:
@@ -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