mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-13 22:01:02 +00:00
Display block propagation time
This commit is contained in:
@@ -77,10 +77,13 @@ export default class Chain {
|
||||
if (node.height > this.height) {
|
||||
this.height = node.height;
|
||||
this.blockTimestamp = node.blockTimestamp;
|
||||
node.propagationTime = 0 as Types.PropagationTime;
|
||||
|
||||
this.feeds.broadcast(Feed.bestBlock(this.height, this.blockTimestamp));
|
||||
|
||||
console.log(`[${this.label}] New block ${this.height}`);
|
||||
} else if (node.height === this.height) {
|
||||
node.propagationTime = (node.blockTimestamp - this.blockTimestamp) as Types.PropagationTime;
|
||||
}
|
||||
|
||||
this.feeds.broadcast(Feed.imported(node));
|
||||
|
||||
@@ -25,6 +25,7 @@ export default class Node {
|
||||
public latency = 0 as Types.Milliseconds;
|
||||
public blockTime = 0 as Types.Milliseconds;
|
||||
public blockTimestamp = 0 as Types.Timestamp;
|
||||
public propagationTime: Maybe<Types.PropagationTime> = null;
|
||||
|
||||
private peers = 0 as Types.PeerCount;
|
||||
private txcount = 0 as Types.TransactionCount;
|
||||
@@ -132,7 +133,7 @@ export default class Node {
|
||||
}
|
||||
|
||||
public blockDetails(): Types.BlockDetails {
|
||||
return [this.height, this.best, this.blockTime, this.blockTimestamp];
|
||||
return [this.height, this.best, this.blockTime, this.blockTimestamp, this.propagationTime];
|
||||
}
|
||||
|
||||
public get average(): number {
|
||||
|
||||
Reference in New Issue
Block a user