Skip to content

Commit

Permalink
feat: display queue details
Browse files Browse the repository at this point in the history
  • Loading branch information
kgmyatthu committed May 7, 2024
1 parent 6435f43 commit fec7818
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions public/large-network.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@
netLoad: 0,
load: 0,
maxLoad: 0,
queueLength: 0,
queueTime: 0,
expiredTx: 0,

},
colorMode: 'state',
shouldShowMaxTps: false,
shouldShowMaxLoad: false,
animateTransactions: false,
queueDetails: false,
}
},
async mounted() {
Expand Down Expand Up @@ -206,13 +211,17 @@
let cycleMarkers = []
let desired = []
let crashedCount = 0
let queueLength = []
let queueTime = []

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

this.networkStatus.tps = report.avgTps
Expand All @@ -232,6 +241,9 @@
if (this.networkStatus.load > this.networkStatus.maxLoad) {
this.networkStatus.maxLoad = this.networkStatus.load
}
this.expiredTx = report.totalExpired
this.networkStatus.queueLength = this.average(queueLength)
this.networkStatus.queueTime = this.average(queueTime)
},
deleteCrashedNodes(nodes) {
console.log('Running delete crash nodes', nodes)
Expand Down
19 changes: 19 additions & 0 deletions views/large-network.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@
</tr>
</table>
</div>

<div style="position: absolute; bottom: 20px; left: 20px" v-if="queueDetails">
<table class="font-sans text-sm font-light text-center bg-gray-100 shadow">
<tr class="font-medium text-xs text-gray-800 grid grid-cols-4">
<td>Exp.Tx</td>
<td>Q.Time</td>
<td>Q.Length</td>
</tr>
<tr class="grid grid-cols-4">
<td>{{ networkStatus.expiredTx }}</td>
<td>{{ networkStatus.queueTime.toFixed(2) }}</td>
<td>{{ networkStatus.queueLength.toFixed(2) }}</td>
</tr>
</table>
</div>
<div id="mynetwork"></div>
<div id="myarchiver"></div>
<div style="position: absolute; bottom: 20px; right: 20px">
Expand Down Expand Up @@ -158,6 +173,10 @@
<input type="checkbox" id="checkbox" v-model="animateTransactions" />
<label class="text-sm" for="checkbox">Animate transactions</label>
</div>
<div>
<input type="checkbox" id="checkbox" v-model="queueDetails" />
<label class="text-sm" for="checkbox">Show Queue Detail</label>
</div>
<a href="/chart" target="_blank" class="text-sm text-blue-400">Charts</a>
<a href="/sync" target="_blank" class="text-sm text-blue-400">Sync History</a>
<a href="/history" target="_blank" class="text-sm text-blue-400"
Expand Down

0 comments on commit fec7818

Please sign in to comment.