@shardus/monitor-client
Advanced tools
Comparing version 2.8.1 to 2.8.2
{ | ||
"name": "@shardus/monitor-client", | ||
"version": "2.8.1", | ||
"version": "2.8.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "entry.js", |
@@ -217,17 +217,17 @@ ;(function main() { | ||
node.radixes = result?.radixes || [] | ||
if (this.hideFullyInSync && this.isUnexpectedOOS(node).total === 0) continue; | ||
this.nodeLoads.push({ | ||
id: nodeId, | ||
ip: node.nodeIpInfo.externalIp, | ||
port: node.nodeIpInfo.externalPort, | ||
inSync: result?.insync, | ||
total: result?.stats.total, | ||
good: result?.stats.good, | ||
bad: result?.stats.bad, | ||
radixes: result?.radixes, | ||
stillNeedsInitialPatchPostActive: node.stillNeedsInitialPatchPostActive, | ||
cycleFinishedSyncing: node.cycleFinishedSyncing, | ||
recentRuntimeSync: result?.radixes.some((r) => r.recentRuntimeSync), | ||
fullRadixArray: this.generateFullRadixArray(node), | ||
}) | ||
if (this.hideFullyInSync && this.isUnexpectedOOS(node).total === 0) continue | ||
this.nodeLoads.push({ | ||
id: nodeId, | ||
ip: node.nodeIpInfo.externalIp, | ||
port: node.nodeIpInfo.externalPort, | ||
inSync: result?.insync, | ||
total: result?.stats.total, | ||
good: result?.stats.good, | ||
bad: result?.stats.bad, | ||
radixes: result?.radixes, | ||
stillNeedsInitialPatchPostActive: node.stillNeedsInitialPatchPostActive, | ||
cycleFinishedSyncing: node.cycleFinishedSyncing, | ||
recentRuntimeSync: result?.radixes.some((r) => r.recentRuntimeSync), | ||
fullRadixArray: this.generateFullRadixArray(node), | ||
}) | ||
} | ||
@@ -285,3 +285,6 @@ }, | ||
let CEUnexpectedOOSCount = 0 | ||
for (let radix of node.radixes) { | ||
const radixes = node.radixes ?? [] | ||
for (let radix of radixes) { | ||
if (CAndCEOnly && radix.inEdgeRange) continue | ||
@@ -316,12 +319,23 @@ if (!radix.insync) { | ||
generateFullRadixArray(node) { | ||
const validRadixes = node.radixes | ||
.map((r) => parseInt(r.radix, 16)) | ||
.filter((r) => !isNaN(r) && r < 1e6) | ||
if (validRadixes.length === 0) { | ||
return [] | ||
} | ||
// Find the maximum radix value | ||
const maxRadix = Math.max(...node.radixes.map(r => parseInt(r.radix, 16))) | ||
const maxRadix = Math.max(...validRadixes) | ||
// Create an array with length maxRadix + 1 (to include 0) | ||
let fullArray = new Array(maxRadix + 1).fill(null) | ||
for (let radix of node.radixes) { | ||
let index = parseInt(radix.radix, 16) | ||
fullArray[index] = radix; | ||
if (!isNaN(index) && index <= maxRadix) { | ||
fullArray[index] = radix | ||
} | ||
} | ||
return fullArray | ||
@@ -328,0 +342,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2415317
5948