Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
manustars authored Oct 7, 2024
1 parent 7193dd5 commit 6776fa8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,18 @@ async function refreshMetrics() {
deviceStatusInfo.labels(rig.v4.mmv.workerName, rig.v4.versions[0], device.dsv.name, device.dsv.id, device.dsv.deviceClass, device.mdv.state)
.set(1);

device.speeds.forEach(speed => {
deviceSpeed.labels(rig.v4.mmv.workerName, device.dsv.name, device.dsv.id, device.dsv.deviceClass, speed.algorithm, speed.displaySuffix)
.set(+speed.speed);
});
if (Array.isArray(device.speeds)) {
device.speeds.forEach(speed => {
deviceSpeed.labels(rig.v4.mmv.workerName, device.dsv.name, device.dsv.id, device.dsv.deviceClass, speed.algorithm, speed.displaySuffix)
.set(+speed.speed);
});
} else {
console.warn("Speeds is undefined or not an array for device:", device.dsv.name);
}
} catch (e) {
console.error("Errore durante il parsing del dispositivo: ", e);
}
});
} catch (e) {
console.error("Errore durante il parsing del dispositivo: ", e);
}
Expand Down

0 comments on commit 6776fa8

Please sign in to comment.