Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GOLD-82 feat: display queue details #1

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading