Skip to content

Commit

Permalink
Clean up large-network view fixes PM-70 (#2)
Browse files Browse the repository at this point in the history
* Clean up large-network view

Add categories for various output in nice tables.
Add some missing values.
Move all info to tables at top of screen instead of being placed all over in random locations.

* ci(script): fix release script

* 2.5.10

* fixed joining nodes counter

* Revert "fixed joining nodes counter"

This reverts commit 4150fa9.

---------

Co-authored-by: Arham Jain <arham.nec@gmail.com>
Co-authored-by: sabdulazeem01 <sabdulazeem01@gmail.com>
  • Loading branch information
3 people authored Jun 7, 2024
1 parent 3263d7c commit fed87e8
Show file tree
Hide file tree
Showing 4 changed files with 253 additions and 202 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@shardus/monitor-client",
"version": "2.5.9",
"version": "2.5.10",
"description": "",
"main": "entry.js",
"engines": {
"node": "18.16.1"
},
"scripts": {
"release": "np --any-branch --no-cleanup --no-tests --no-yarn",
"release": "np --any-branch --no-cleanup --no-tests --no-yarn --branch dev",
"test": "echo \"Error: no test specified\" && exit 1",
"compile": "tsc -p .",
"prepare": "npm run compile",
Expand All @@ -18,7 +18,7 @@
},
"repository": {
"type": "git",
"url": "https://gitlab.com/shardus/enterprise/monitor-client.git"
"url": "git@github.com:shardeum/x-monitor-client.git"
},
"publishConfig": {
"access": "public"
Expand Down
20 changes: 15 additions & 5 deletions public/large-network.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;(function main() {
; (function main() {
const G = {}
loadToken(G)
G.VW = Math.max(document.documentElement.clientWidth, window.innerWidth || 0)
Expand Down Expand Up @@ -39,15 +39,16 @@
rejectedTps: 0,
netLoad: 0,
load: 0,
totalLoad: 0,
maxLoad: 0,
queueLength: 0,
totalQueueLength: 0,
queueTime: 0,
totalQueueTime: 0,
expiredTx: 0,

},
colorMode: 'state',
shouldShowMaxTps: false,
shouldShowMaxLoad: false,
animateTransactions: false,
queueDetails: false,
}
Expand Down Expand Up @@ -214,13 +215,20 @@
let queueLength = []
let queueTime = []

let totalLoad = 0
let totalQueueLength = 0
let totalQueueTime = 0.0

for (let nodeId in report.nodes.active) {
const node = report.nodes.active[nodeId]
totalLoad += node.currentLoad.networkLoad
loads.push(node.currentLoad.networkLoad)
counters.push(node.cycleCounter)
cycleMarkers.push(node.cycleMarker)
desired.push(node.desiredNodes)
totalQueueLength += node.queueLength
queueLength.push(node.queueLength)
totalQueueTime += node.txTimeInQueue
queueTime.push(node.txTimeInQueue)
}

Expand All @@ -235,6 +243,7 @@
this.networkStatus.standby = Object.keys(report.nodes.standby).length

this.networkStatus.load = this.average(loads)
this.networkStatus.totalLoad = totalLoad
this.networkStatus.counter = this.mode(counters)
this.networkStatus.cycleMarker = this.mode(cycleMarkers)
this.networkStatus.desired = this.mode(desired)
Expand All @@ -243,7 +252,9 @@
}
this.expiredTx = report.totalExpired
this.networkStatus.queueLength = this.average(queueLength)
this.networkStatus.totalQueueLength = totalQueueLength
this.networkStatus.queueTime = this.average(queueTime)
this.networkStatus.totalQueueTime = totalQueueTime
},
deleteCrashedNodes(nodes) {
console.log('Running delete crash nodes', nodes)
Expand Down Expand Up @@ -325,8 +336,7 @@
try {
let changes = await this.fetchChanges()
console.log(
`Total of ${Object.keys(changes.nodes.active).length}/${
Object.keys(G.nodes.active).length
`Total of ${Object.keys(changes.nodes.active).length}/${Object.keys(G.nodes.active).length
} nodes updated.`
)
this.filterOutCrashedNodes(changes)
Expand Down
Loading

0 comments on commit fed87e8

Please sign in to comment.