Skip to content

Commit

Permalink
Split up the returned oos but node type.
Browse files Browse the repository at this point in the history
  • Loading branch information
urnotsam committed Jul 12, 2024
1 parent 143e540 commit fd4e551
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
19 changes: 16 additions & 3 deletions public/sync-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@
},
isUnexpectedOOS(node, CAndCEOnly = false) {
const currentCounter = this.networkStatus.counter
let unexpectedOOSCount = 0
let CUnexpectedOOSCount = 0
let EUnexpectedOOSCount = 0
let CEUnexpectedOOSCount = 0

for (let radix of node.radixes) {
if (CAndCEOnly && !(radix.inConsensusRange || radix.inEdgeRange)) continue
Expand All @@ -280,12 +282,23 @@
const hasRecentSync = radix.recentRuntimeSync

if (!recentlyActive && !hasRecentSync) {
unexpectedOOSCount++
if (radix.inConsensusRange && radix.isEdgeRange) {
CEUnexpectedOOSCount++
} else if (radix.inConsensusRange) {
CUnexpectedOOSCount++
} else if (radix.inEdgeRange) {
EUnexpectedOOSCount++
}
}
}
}

return unexpectedOOSCount
return {
total: CUnexpectedOOSCount + EUnexpectedOOSCount + CEUnexpectedOOSCount,
C: CUnexpectedOOSCount,
E: EUnexpectedOOSCount,
CE: CEUnexpectedOOSCount,
}
},
async start() {
let res = await requestWithToken(`${monitorServerUrl}/report`)
Expand Down
6 changes: 3 additions & 3 deletions views/sync-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<th>Radixes</th>
</tr>
<tr>
<th colspan="9"></th>
<th colspan="10"></th>
<th @click="sortTable('unexpectedOOSAll')">All</th>
<th @click="sortTable('unexpectedOOSC')">C/CE</th>
<th></th>
Expand All @@ -174,8 +174,8 @@
<td>{{ node.stillNeedsInitialPatchPostActive }}</td>
<td>{{ node.cycleFinishedSyncing }}</td>
<td>{{ node.recentRuntimeSync }}</td>
<td>{{ isUnexpectedOOS(node) ? `true (${isUnexpectedOOS(node)})` : false}}</td>
<td>{{ isUnexpectedOOS(node, true) ? `true (${isUnexpectedOOS(node)})` : false}}</td>
<td>{{ isUnexpectedOOS(node).total ? `true (${isUnexpectedOOS(node).total})` : false}}</td>
<td>{{ isUnexpectedOOS(node, true).total ? `true (${isUnexpectedOOS(node).total})` : false}}</td>
<td>
<template>
<div>
Expand Down

0 comments on commit fd4e551

Please sign in to comment.