Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4d0cb65f0 | ||
|
|
29b9b17c67 | ||
|
|
8deecf3558 | ||
|
|
3a6a190ce1 |
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"bench_parse_line_near_max_addrs": 11524996.0,
|
"bench_parse_line_near_max_addrs": 3901086.0,
|
||||||
"bench_parse_targets_many_ranges_near_cap": 249042410.0,
|
"bench_parse_targets_many_ranges_near_cap": 290127400.0,
|
||||||
"bench_render_cells": 23978036.0,
|
"bench_render_cells": 29363207.0,
|
||||||
"bench_sort_by_each_column": 6301818.0,
|
"bench_sort_by_each_column": 4468641.0,
|
||||||
"bench_targets_to_cidrs_large_range": 1660473.0,
|
"bench_targets_to_cidrs_large_range": 3605972.0,
|
||||||
"bench_upsert_cold_start_population": 51907853.0,
|
"bench_upsert_cold_start_population": 91616782.0,
|
||||||
"bench_view_pipeline": 824155.0,
|
"bench_view_pipeline": 1396303.0,
|
||||||
"bench_view_pipeline_default_sort": 2048491.0,
|
"bench_view_pipeline_default_sort": 2723906.0,
|
||||||
"bench_view_pipeline_with_filter": 1358661.0
|
"bench_view_pipeline_with_filter": 1491721.0
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="147.5" height="20" role="img" aria-label="bench: +13.2% vs prev">
|
<svg xmlns="http://www.w3.org/2000/svg" width="147.5" height="20" role="img" aria-label="bench: +52.9% vs prev">
|
||||||
<title>bench: +13.2% vs prev</title>
|
<title>bench: +52.9% vs prev</title>
|
||||||
<linearGradient id="s" x2="0" y2="100%">
|
<linearGradient id="s" x2="0" y2="100%">
|
||||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||||
<stop offset="1" stop-opacity=".1"/>
|
<stop offset="1" stop-opacity=".1"/>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
||||||
<text x="22.2" y="15" fill="#010101" fill-opacity=".3">bench</text>
|
<text x="22.2" y="15" fill="#010101" fill-opacity=".3">bench</text>
|
||||||
<text x="22.2" y="14">bench</text>
|
<text x="22.2" y="14">bench</text>
|
||||||
<text x="96.0" y="15" fill="#010101" fill-opacity=".3">+13.2% vs prev</text>
|
<text x="96.0" y="15" fill="#010101" fill-opacity=".3">+52.9% vs prev</text>
|
||||||
<text x="96.0" y="14">+13.2% vs prev</text>
|
<text x="96.0" y="14">+52.9% vs prev</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 955 B After Width: | Height: | Size: 955 B |
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="95.5" height="20" role="img" aria-label="coverage: 43%">
|
<svg xmlns="http://www.w3.org/2000/svg" width="95.5" height="20" role="img" aria-label="coverage: 44%">
|
||||||
<title>coverage: 43%</title>
|
<title>coverage: 44%</title>
|
||||||
<linearGradient id="s" x2="0" y2="100%">
|
<linearGradient id="s" x2="0" y2="100%">
|
||||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||||
<stop offset="1" stop-opacity=".1"/>
|
<stop offset="1" stop-opacity=".1"/>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
||||||
<text x="32.0" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
<text x="32.0" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
||||||
<text x="32.0" y="14">coverage</text>
|
<text x="32.0" y="14">coverage</text>
|
||||||
<text x="79.8" y="15" fill="#010101" fill-opacity=".3">43%</text>
|
<text x="79.8" y="15" fill="#010101" fill-opacity=".3">44%</text>
|
||||||
<text x="79.8" y="14">43%</text>
|
<text x="79.8" y="14">44%</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
@@ -128,6 +128,10 @@ impl Board {
|
|||||||
cpu,
|
cpu,
|
||||||
board_code,
|
board_code,
|
||||||
hashrate_ths: self.hashrate,
|
hashrate_ths: self.hashrate,
|
||||||
|
// A miner that is mining or paused reported a current hashrate (a paused
|
||||||
|
// one reports 0 -> "0.00T"); the blank stock demo miner reports none, so
|
||||||
|
// it keeps the "-" dash (round 19 follow-up).
|
||||||
|
hashrate_known: self.mining || self.paused,
|
||||||
expected_ths: self.expected,
|
expected_ths: self.expected,
|
||||||
board_hashrates,
|
board_hashrates,
|
||||||
board_voltages,
|
board_voltages,
|
||||||
|
|||||||
@@ -82,6 +82,17 @@ pub fn format_hashrate_ths(ths: f64) -> Option<String> {
|
|||||||
si_mantissa_and_prefix(ths * 1e12).map(|(num, prefix)| format!("{num}{prefix}"))
|
si_mantissa_and_prefix(ths * 1e12).map(|(num, prefix)| format!("{num}{prefix}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The current-hashrate reading for the combined Hashrate cell, distinguishing a
|
||||||
|
/// reported zero from an unreadable one: `Some("0.00T")` when the firmware reported
|
||||||
|
/// a hashrate that rounds to zero, `Some("<n>T")` for a positive reading, and
|
||||||
|
/// `None` (renders as the "-" dash) only when the hashrate is unreadable/absent.
|
||||||
|
pub fn format_hashrate_actual(ths: f64, known: bool) -> Option<String> {
|
||||||
|
if !known {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Some(format_hashrate_ths(ths).unwrap_or_else(|| "0.00T".to_string()))
|
||||||
|
}
|
||||||
|
|
||||||
/// A hashrate number (no unit) for a given mining algorithm (round 18 #7). asic-rs
|
/// A hashrate number (no unit) for a given mining algorithm (round 18 #7). asic-rs
|
||||||
/// stores every hashrate normalised to "TH/s", but for Equihash the underlying
|
/// stores every hashrate normalised to "TH/s", but for Equihash the underlying
|
||||||
/// count is Sol/s that it reinterprets through the base H unit, so `ths * 1e12`
|
/// count is Sol/s that it reinterprets through the base H unit, so `ths * 1e12`
|
||||||
@@ -140,8 +151,8 @@ fn join_board(vals: &[f64], f: impl Fn(f64) -> String) -> String {
|
|||||||
/// slash, prefix-only unit): blank when neither is known, the bare actual when
|
/// slash, prefix-only unit): blank when neither is known, the bare actual when
|
||||||
/// only it is known, "-/<expected>" when only the expected is known, and
|
/// only it is known, "-/<expected>" when only the expected is known, and
|
||||||
/// "<actual>/<expected>" when both are (e.g. "80.5T/95.0T").
|
/// "<actual>/<expected>" when both are (e.g. "80.5T/95.0T").
|
||||||
fn combined_si(actual_ths: f64, expected_ths: f64) -> String {
|
fn combined_si(actual_ths: f64, actual_known: bool, expected_ths: f64) -> String {
|
||||||
match (format_hashrate_ths(actual_ths), format_hashrate_ths(expected_ths)) {
|
match (format_hashrate_actual(actual_ths, actual_known), format_hashrate_ths(expected_ths)) {
|
||||||
(None, None) => String::new(),
|
(None, None) => String::new(),
|
||||||
(Some(a), None) => a,
|
(Some(a), None) => a,
|
||||||
(None, Some(e)) => format!("-/{e}"),
|
(None, Some(e)) => format!("-/{e}"),
|
||||||
@@ -496,6 +507,10 @@ pub struct MinerRow {
|
|||||||
pub faults: Vec<Fault>,
|
pub faults: Vec<Fault>,
|
||||||
// performance
|
// performance
|
||||||
pub hashrate_ths: f64,
|
pub hashrate_ths: f64,
|
||||||
|
/// Whether the firmware actually reported a current hashrate. A reported 0
|
||||||
|
/// renders as "0.00T"; only an unreadable/absent reading (this is false) shows
|
||||||
|
/// the "-" dash. `hashrate_ths` alone can't distinguish the two (both are 0.0).
|
||||||
|
pub hashrate_known: bool,
|
||||||
/// Rolling average hashrate windows in TH/s (round 19 #10, T2): 1m/5m/15m/24h.
|
/// Rolling average hashrate windows in TH/s (round 19 #10, T2): 1m/5m/15m/24h.
|
||||||
/// 0.0 means the firmware does not report that window.
|
/// 0.0 means the firmware does not report that window.
|
||||||
pub hashrate_1m_ths: f64,
|
pub hashrate_1m_ths: f64,
|
||||||
@@ -1046,8 +1061,20 @@ impl MinerRow {
|
|||||||
/// counted as operator-paused when it is not currently mining and its raw
|
/// counted as operator-paused when it is not currently mining and its raw
|
||||||
/// operating-state string says so (case-insensitively), shared by the live
|
/// operating-state string says so (case-insensitively), shared by the live
|
||||||
/// scan (`scan::to_row`) and the fixtures/tests.
|
/// scan (`scan::to_row`) and the fixtures/tests.
|
||||||
|
///
|
||||||
|
/// "Paused" covers every intentional, resumable halt -- operator- or
|
||||||
|
/// firmware-initiated -- not just the literal "Paused" state: a miner an operator
|
||||||
|
/// stopped is halted on purpose, not broken, so it must read blue in Health and
|
||||||
|
/// count under the Paused KPI rather than "not hashing". Firmwares spell it
|
||||||
|
/// differently: VNish reports "stopped", Braiins uses Paused/Stopped/Suspended,
|
||||||
|
/// others "paused". A failure is a distinct Error state (never matched here) and
|
||||||
|
/// still reads as broken (round 19 #19).
|
||||||
pub fn is_paused(operating_state: &str, is_mining: bool) -> bool {
|
pub fn is_paused(operating_state: &str, is_mining: bool) -> bool {
|
||||||
!is_mining && operating_state.to_lowercase().contains("pause")
|
if is_mining {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let s = operating_state.to_lowercase();
|
||||||
|
s.contains("pause") || s.contains("stop") || s.contains("suspend")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The typed-confirmation gate for the irreversible firmware-flash action: the
|
/// The typed-confirmation gate for the irreversible firmware-flash action: the
|
||||||
@@ -1477,7 +1504,10 @@ impl Column {
|
|||||||
// renders "- / <expected>" (non-empty) in that case, so the generic
|
// renders "- / <expected>" (non-empty) in that case, so the generic
|
||||||
// blank check below is not enough on its own.
|
// blank check below is not enough on its own.
|
||||||
match self {
|
match self {
|
||||||
Column::Hashrate if r.hashrate_ths <= 0.0 => return None,
|
// An unreadable hashrate has no numeric value; a reported 0 does (0.0),
|
||||||
|
// so a filter like "hashrate > 0" excludes a stopped miner but "<= 50"
|
||||||
|
// still matches it.
|
||||||
|
Column::Hashrate if !r.hashrate_known => return None,
|
||||||
Column::TotalChips if r.total_chips.is_none() => return None,
|
Column::TotalChips if r.total_chips.is_none() => return None,
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
@@ -1584,7 +1614,7 @@ impl Column {
|
|||||||
let pool_worker = |i: usize| r.pools.get(i).map(|(_, w)| w.clone()).unwrap_or_default();
|
let pool_worker = |i: usize| r.pools.get(i).map(|(_, w)| w.clone()).unwrap_or_default();
|
||||||
match self {
|
match self {
|
||||||
Column::Ip => r.ip.clone(),
|
Column::Ip => r.ip.clone(),
|
||||||
Column::Hashrate => combined_si(r.hashrate_ths, r.expected_ths),
|
Column::Hashrate => combined_si(r.hashrate_ths, r.hashrate_known, r.expected_ths),
|
||||||
// Rolling average windows: a single TH/s value, blank when not reported
|
// Rolling average windows: a single TH/s value, blank when not reported
|
||||||
// (round 19 #10, T2).
|
// (round 19 #10, T2).
|
||||||
Column::Hashrate1m => format_hashrate_ths(r.hashrate_1m_ths).unwrap_or_default(),
|
Column::Hashrate1m => format_hashrate_ths(r.hashrate_1m_ths).unwrap_or_default(),
|
||||||
@@ -2814,7 +2844,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn numeric_filter_operators() {
|
fn numeric_filter_operators() {
|
||||||
let r = MinerRow { hashrate_ths: 100.0, is_mining: true, ..Default::default() };
|
let r = MinerRow { hashrate_ths: 100.0, hashrate_known: true, is_mining: true, ..Default::default() };
|
||||||
let c = Column::Hashrate;
|
let c = Column::Hashrate;
|
||||||
let n = |op, a: f64, b: f64| ColFilter::Num { op, a, b }.matches(c, &r);
|
let n = |op, a: f64, b: f64| ColFilter::Num { op, a, b }.matches(c, &r);
|
||||||
assert!(n(NumOp::Gt, 50.0, 0.0));
|
assert!(n(NumOp::Gt, 50.0, 0.0));
|
||||||
@@ -2835,7 +2865,7 @@ mod tests {
|
|||||||
assert_eq!(Column::Firmware.num_value(&r), None, "text column");
|
assert_eq!(Column::Firmware.num_value(&r), None, "text column");
|
||||||
assert_eq!(Column::Ip.num_value(&r), None, "IP is text, not numeric");
|
assert_eq!(Column::Ip.num_value(&r), None, "IP is text, not numeric");
|
||||||
assert_eq!(Column::Efficiency.num_value(&r), None, "blank numeric -> None");
|
assert_eq!(Column::Efficiency.num_value(&r), None, "blank numeric -> None");
|
||||||
let r2 = MinerRow { hashrate_ths: 42.0, ..Default::default() };
|
let r2 = MinerRow { hashrate_ths: 42.0, hashrate_known: true, ..Default::default() };
|
||||||
assert_eq!(Column::Hashrate.num_value(&r2), Some(42.0));
|
assert_eq!(Column::Hashrate.num_value(&r2), Some(42.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2908,6 +2938,7 @@ mod tests {
|
|||||||
|
|
||||||
let actual_only = MinerRow {
|
let actual_only = MinerRow {
|
||||||
hashrate_ths: 60.0,
|
hashrate_ths: 60.0,
|
||||||
|
hashrate_known: true,
|
||||||
total_chips: Some(210),
|
total_chips: Some(210),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
@@ -2919,11 +2950,24 @@ mod tests {
|
|||||||
expected_chips: Some(228),
|
expected_chips: Some(228),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
assert_eq!(Column::Hashrate.cell(&expected_only), "-/200T", "only expected -> '-/<expected>'");
|
assert_eq!(Column::Hashrate.cell(&expected_only), "-/200T", "only expected (actual unreadable) -> '-/<expected>'");
|
||||||
assert_eq!(Column::TotalChips.cell(&expected_only), "- / 228");
|
assert_eq!(Column::TotalChips.cell(&expected_only), "- / 228");
|
||||||
|
|
||||||
|
// A reported zero is a real reading -> "0.00T", never the dash. The dash
|
||||||
|
// (expected_only above) is reserved for an unreadable actual.
|
||||||
|
let reported_zero = MinerRow {
|
||||||
|
hashrate_ths: 0.0,
|
||||||
|
hashrate_known: true,
|
||||||
|
expected_ths: 200.0,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
assert_eq!(Column::Hashrate.cell(&reported_zero), "0.00T/200T", "reported 0 -> 0.00T, not a dash");
|
||||||
|
let reported_zero_no_expected = MinerRow { hashrate_ths: 0.0, hashrate_known: true, ..Default::default() };
|
||||||
|
assert_eq!(Column::Hashrate.cell(&reported_zero_no_expected), "0.00T");
|
||||||
|
|
||||||
let both = MinerRow {
|
let both = MinerRow {
|
||||||
hashrate_ths: 60.0,
|
hashrate_ths: 60.0,
|
||||||
|
hashrate_known: true,
|
||||||
expected_ths: 200.0,
|
expected_ths: 200.0,
|
||||||
total_chips: Some(190),
|
total_chips: Some(190),
|
||||||
expected_chips: Some(228),
|
expected_chips: Some(228),
|
||||||
@@ -2947,6 +2991,7 @@ mod tests {
|
|||||||
|
|
||||||
let both = MinerRow {
|
let both = MinerRow {
|
||||||
hashrate_ths: 60.0,
|
hashrate_ths: 60.0,
|
||||||
|
hashrate_known: true,
|
||||||
expected_ths: 200.0,
|
expected_ths: 200.0,
|
||||||
total_chips: Some(190),
|
total_chips: Some(190),
|
||||||
expected_chips: Some(228),
|
expected_chips: Some(228),
|
||||||
@@ -3020,8 +3065,16 @@ mod tests {
|
|||||||
fn is_paused_detection() {
|
fn is_paused_detection() {
|
||||||
assert!(is_paused("Paused", false));
|
assert!(is_paused("Paused", false));
|
||||||
assert!(is_paused("PAUSED (manual)", false));
|
assert!(is_paused("PAUSED (manual)", false));
|
||||||
assert!(!is_paused("Paused", true), "mining overrides an even stale 'paused' state string");
|
// Intentional halts other firmwares report: VNish "Stopped" (miner_state
|
||||||
|
// "stopped"), Braiins "Suspended", a "Stopping" transition (round 19 #19 /
|
||||||
|
// 10.4.1.122 read as broken before this).
|
||||||
|
assert!(is_paused("Stopped", false), "an operator-stopped miner is paused, not broken");
|
||||||
|
assert!(is_paused("Stopping", false));
|
||||||
|
assert!(is_paused("Suspended", false));
|
||||||
|
assert!(!is_paused("Stopped", true), "mining overrides a stale 'stopped' state string");
|
||||||
assert!(!is_paused("Mining", false));
|
assert!(!is_paused("Mining", false));
|
||||||
|
assert!(!is_paused("Error", false), "a failure is broken, not paused");
|
||||||
|
assert!(!is_paused("Idling", false), "plain idle is not an explicit halt");
|
||||||
assert!(!is_paused("", false));
|
assert!(!is_paused("", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -747,6 +747,9 @@ fn partial_row(miner: &dyn Miner, ip: std::net::IpAddr) -> MinerRow {
|
|||||||
|
|
||||||
async fn to_row(miner: &dyn Miner) -> MinerRow {
|
async fn to_row(miner: &dyn Miner) -> MinerRow {
|
||||||
let data = miner.get_data().await;
|
let data = miner.get_data().await;
|
||||||
|
// Whether the firmware reported a current hashrate at all: a reported 0 renders
|
||||||
|
// "0.00T", an absent one the "-" dash (round 19 follow-up).
|
||||||
|
let hashrate_known = data.hashrate.is_some();
|
||||||
let hashrate_ths = data
|
let hashrate_ths = data
|
||||||
.hashrate
|
.hashrate
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@@ -1111,6 +1114,7 @@ async fn to_row(miner: &dyn Miner) -> MinerRow {
|
|||||||
cpu,
|
cpu,
|
||||||
board_code,
|
board_code,
|
||||||
hashrate_ths,
|
hashrate_ths,
|
||||||
|
hashrate_known,
|
||||||
hashrate_1m_ths,
|
hashrate_1m_ths,
|
||||||
hashrate_5m_ths,
|
hashrate_5m_ths,
|
||||||
hashrate_15m_ths,
|
hashrate_15m_ths,
|
||||||
|
|||||||
+30
-12
@@ -438,28 +438,44 @@ fn encode_component_health(
|
|||||||
max_fans: usize,
|
max_fans: usize,
|
||||||
max_boards: usize,
|
max_boards: usize,
|
||||||
) -> String {
|
) -> String {
|
||||||
|
use crate::model::CompHealth;
|
||||||
let mut segs: Vec<Segment> = Vec::new();
|
let mut segs: Vec<Segment> = Vec::new();
|
||||||
|
// On a paused/stopped miner, a component that is off *because* the miner is
|
||||||
|
// halted is expected, not a fault, so it reads blue (paused) instead of red.
|
||||||
|
// But this only applies where "not working" is a consequence of the pause:
|
||||||
|
// - Hashboards: idle (not hashing) is exactly what pausing does -> blue when
|
||||||
|
// paused (any detected board; an undetected one stays grey). Round 19 #19.
|
||||||
|
// - Fans: blue ONLY when actually stopped (0 RPM -> Down); a fan still
|
||||||
|
// spinning stays green/amber -- pausing doesn't necessarily stop the fans.
|
||||||
|
// - Control board + PSU: still running / powered, so they keep their true
|
||||||
|
// health (green when fine) even while paused -- never forced blue.
|
||||||
|
let paused = r.paused;
|
||||||
|
let board_col = |h: CompHealth| {
|
||||||
|
if paused && h != CompHealth::Unreachable {
|
||||||
|
pal.accent
|
||||||
|
} else {
|
||||||
|
health_color(pal, h)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let fan_col = |h: CompHealth| {
|
||||||
|
if paused && h == CompHealth::Down {
|
||||||
|
pal.accent
|
||||||
|
} else {
|
||||||
|
health_color(pal, h)
|
||||||
|
}
|
||||||
|
};
|
||||||
segs.push((Some(health_color(pal, r.power_health())), SHAPE_BOLT.to_string()));
|
segs.push((Some(health_color(pal, r.power_health())), SHAPE_BOLT.to_string()));
|
||||||
segs.push((Some(health_color(pal, r.control_health())), SHAPE_BRAIN.to_string()));
|
segs.push((Some(health_color(pal, r.control_health())), SHAPE_BRAIN.to_string()));
|
||||||
let fans = r.fan_healths();
|
let fans = r.fan_healths();
|
||||||
for h in &fans {
|
for h in &fans {
|
||||||
segs.push((Some(health_color(pal, *h)), SHAPE_FAN.to_string()));
|
segs.push((Some(fan_col(*h)), SHAPE_FAN.to_string()));
|
||||||
}
|
}
|
||||||
for _ in fans.len()..max_fans {
|
for _ in fans.len()..max_fans {
|
||||||
segs.push((None, SHAPE_GAP.to_string()));
|
segs.push((None, SHAPE_GAP.to_string()));
|
||||||
}
|
}
|
||||||
let boards = r.board_healths();
|
let boards = r.board_healths();
|
||||||
for h in &boards {
|
for h in &boards {
|
||||||
// A paused miner's boards are intentionally idle, not faulty: show every
|
segs.push((Some(board_col(*h)), SHAPE_CHIP.to_string()));
|
||||||
// detected board blue instead of its (red) health colour, while every
|
|
||||||
// other component keeps its normal colour. A genuinely undetected board
|
|
||||||
// stays grey (round 19 #19).
|
|
||||||
let color = if r.paused && *h != crate::model::CompHealth::Unreachable {
|
|
||||||
pal.accent
|
|
||||||
} else {
|
|
||||||
health_color(pal, *h)
|
|
||||||
};
|
|
||||||
segs.push((Some(color), SHAPE_CHIP.to_string()));
|
|
||||||
}
|
}
|
||||||
for _ in boards.len()..max_boards {
|
for _ in boards.len()..max_boards {
|
||||||
segs.push((None, SHAPE_GAP.to_string()));
|
segs.push((None, SHAPE_GAP.to_string()));
|
||||||
@@ -1269,7 +1285,9 @@ impl App {
|
|||||||
// on the ACTUAL being known, so an unknown actual renders as
|
// on the ACTUAL being known, so an unknown actual renders as
|
||||||
// "-/<expected>" in the default colour rather than a red 0%.
|
// "-/<expected>" in the default colour rather than a red 0%.
|
||||||
Column::Hashrate => {
|
Column::Hashrate => {
|
||||||
let actual = format_hashrate_ths(r.hashrate_ths);
|
// A reported 0 shows "0.00T" (not a dash); the dash is only for
|
||||||
|
// an unreadable reading (hashrate_known == false).
|
||||||
|
let actual = format_hashrate_actual(r.hashrate_ths, r.hashrate_known);
|
||||||
let expected = format_hashrate_ths(r.expected_ths);
|
let expected = format_hashrate_ths(r.expected_ths);
|
||||||
let ratio = (r.hashrate_ths > 0.0)
|
let ratio = (r.hashrate_ths > 0.0)
|
||||||
.then(|| actual_expected_ratio(r.hashrate_ths, r.expected_ths))
|
.then(|| actual_expected_ratio(r.hashrate_ths, r.expected_ths))
|
||||||
|
|||||||
+283
@@ -0,0 +1,283 @@
|
|||||||
|
Subject: [PATCH 0032] telemetry: vnish per-hashboard fault messages
|
||||||
|
|
||||||
|
Round 20 #1. VNish previously surfaced only a single miner-level state message
|
||||||
|
(board 0, no component), so per-hashboard faults landed on the control-board
|
||||||
|
(brain) tooltip instead of the board they name, and the Health column could not
|
||||||
|
red the specific faulted hashboard.
|
||||||
|
|
||||||
|
- DataField::Messages now also collects /miner/chains from the summary (tagged),
|
||||||
|
alongside /miner/miner_status (now tagged "miner_status"). The summary chains
|
||||||
|
carry per-chain diagnostics the /chains endpoint omits: chip_statuses
|
||||||
|
{red,orange,grey} and status.state.
|
||||||
|
- parse_messages emits one MinerMessage per faulted board, attributed to
|
||||||
|
MinerComponent::HashBoard { idx } (chain ids are 1-based; board positions
|
||||||
|
0-based): red chip(s) -> Error, a non-normal chain state with no failed chips
|
||||||
|
-> Error (state text), orange chip(s) -> Warning. Healthy boards (all grey,
|
||||||
|
state "mining") produce no message, so no false faults on good miners.
|
||||||
|
- Applied to both v1_3_0 and v1_2_0 backends. Verified live against healthy
|
||||||
|
WildRose/VNish S21 miners (10.7.1.x): all chains grey/mining -> zero messages.
|
||||||
|
|
||||||
|
diff --git a/vendor/asic-rs-firmwares-vnish/src/backends/v1_2_0/mod.rs b/vendor/asic-rs-firmwares-vnish/src/backends/v1_2_0/mod.rs
|
||||||
|
index ad2779b6..85011853 100644
|
||||||
|
--- a/vendor/asic-rs-firmwares-vnish/src/backends/v1_2_0/mod.rs
|
||||||
|
+++ b/vendor/asic-rs-firmwares-vnish/src/backends/v1_2_0/mod.rs
|
||||||
|
@@ -20,7 +20,7 @@ use asic_rs_core::{
|
||||||
|
device::DeviceInfo,
|
||||||
|
fan::FanData,
|
||||||
|
hashrate::{HashRate, HashRateUnit},
|
||||||
|
- message::{MessageSeverity, MinerMessage},
|
||||||
|
+ message::{MessageSeverity, MinerComponent, MinerMessage},
|
||||||
|
miner::TuningTarget,
|
||||||
|
operating_state::OperatingState,
|
||||||
|
pool::{PoolData, PoolGroupData, PoolURL},
|
||||||
|
@@ -353,14 +353,26 @@ impl GetDataLocations for VnishV120 {
|
||||||
|
tag: None,
|
||||||
|
},
|
||||||
|
)],
|
||||||
|
- DataField::Messages => vec![(
|
||||||
|
- WEB_SUMMARY,
|
||||||
|
- DataExtractor {
|
||||||
|
- func: get_by_pointer,
|
||||||
|
- key: Some("/miner/miner_status"),
|
||||||
|
- tag: None,
|
||||||
|
- },
|
||||||
|
- )],
|
||||||
|
+ DataField::Messages => vec![
|
||||||
|
+ (
|
||||||
|
+ WEB_SUMMARY,
|
||||||
|
+ DataExtractor {
|
||||||
|
+ func: get_by_pointer,
|
||||||
|
+ key: Some("/miner/miner_status"),
|
||||||
|
+ tag: Some("miner_status"),
|
||||||
|
+ },
|
||||||
|
+ ),
|
||||||
|
+ // Per-hashboard diagnostics (chip status buckets + per-chain state)
|
||||||
|
+ // for per-board fault messages in parse_messages.
|
||||||
|
+ (
|
||||||
|
+ WEB_SUMMARY,
|
||||||
|
+ DataExtractor {
|
||||||
|
+ func: get_by_pointer,
|
||||||
|
+ key: Some("/miner/chains"),
|
||||||
|
+ tag: Some("chains"),
|
||||||
|
+ },
|
||||||
|
+ ),
|
||||||
|
+ ],
|
||||||
|
DataField::TuningTarget => vec![(
|
||||||
|
WEB_SETTINGS,
|
||||||
|
DataExtractor {
|
||||||
|
@@ -850,9 +862,12 @@ impl GetMessages for VnishV120 {
|
||||||
|
/// reported here rather than computed from invented thresholds.
|
||||||
|
fn parse_messages(&self, data: &HashMap<DataField, Value>) -> Vec<MinerMessage> {
|
||||||
|
let mut messages = Vec::new();
|
||||||
|
+ let msg = data.get(&DataField::Messages);
|
||||||
|
|
||||||
|
- if let Some(status) = data.get(&DataField::Messages)
|
||||||
|
- && let Some(state) = status.pointer("/miner_state").and_then(|v| v.as_str())
|
||||||
|
+ // Miner-level state verdict (now under the "miner_status" tag).
|
||||||
|
+ if let Some(state) = msg
|
||||||
|
+ .and_then(|v| v.pointer("/miner_status/miner_state"))
|
||||||
|
+ .and_then(|v| v.as_str())
|
||||||
|
{
|
||||||
|
let normal = matches!(
|
||||||
|
state.to_lowercase().as_str(),
|
||||||
|
@@ -872,6 +887,68 @@ impl GetMessages for VnishV120 {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Per-hashboard faults from the summary chains (round 20 #1). VNish reports
|
||||||
|
+ // per-chip status buckets (`red` = failed, `orange` = degraded, `grey` =
|
||||||
|
+ // healthy) and a per-chain state; attribute each fault to its own board so
|
||||||
|
+ // the Health column reds the right hashboard icon and that icon's tooltip
|
||||||
|
+ // carries the specific fault, instead of everything landing on the miner-
|
||||||
|
+ // level (brain) message. Chain ids are 1-based; board positions are 0-based.
|
||||||
|
+ if let Some(chains) = msg
|
||||||
|
+ .and_then(|v| v.pointer("/chains"))
|
||||||
|
+ .and_then(|v| v.as_array())
|
||||||
|
+ {
|
||||||
|
+ for chain in chains {
|
||||||
|
+ let Some(id) = chain.pointer("/id").and_then(|v| v.as_u64()) else {
|
||||||
|
+ continue;
|
||||||
|
+ };
|
||||||
|
+ let idx = id.saturating_sub(1) as u16;
|
||||||
|
+ let red = chain
|
||||||
|
+ .pointer("/chip_statuses/red")
|
||||||
|
+ .and_then(|v| v.as_u64())
|
||||||
|
+ .unwrap_or(0);
|
||||||
|
+ let orange = chain
|
||||||
|
+ .pointer("/chip_statuses/orange")
|
||||||
|
+ .and_then(|v| v.as_u64())
|
||||||
|
+ .unwrap_or(0);
|
||||||
|
+ let state = chain
|
||||||
|
+ .pointer("/status/state")
|
||||||
|
+ .and_then(|v| v.as_str())
|
||||||
|
+ .unwrap_or("");
|
||||||
|
+ let state_ok = matches!(
|
||||||
|
+ state.to_lowercase().as_str(),
|
||||||
|
+ "" | "mining" | "auto-tuning" | "auto_tuning" | "tuning"
|
||||||
|
+ );
|
||||||
|
+
|
||||||
|
+ if red > 0 {
|
||||||
|
+ messages.push(MinerMessage::with_component(
|
||||||
|
+ 0,
|
||||||
|
+ 0,
|
||||||
|
+ format!("Hashboard {id}: {red} failed chip(s)"),
|
||||||
|
+ MessageSeverity::Error,
|
||||||
|
+ Some(MinerComponent::hashboard(idx)),
|
||||||
|
+ ));
|
||||||
|
+ } else if !state_ok {
|
||||||
|
+ // A board not in a normal state but with no failed chips: report
|
||||||
|
+ // the state itself (e.g. "initializing", "disabled", "stopped").
|
||||||
|
+ messages.push(MinerMessage::with_component(
|
||||||
|
+ 0,
|
||||||
|
+ 0,
|
||||||
|
+ format!("Hashboard {id}: {state}"),
|
||||||
|
+ MessageSeverity::Error,
|
||||||
|
+ Some(MinerComponent::hashboard(idx)),
|
||||||
|
+ ));
|
||||||
|
+ } else if orange > 0 {
|
||||||
|
+ messages.push(MinerMessage::with_component(
|
||||||
|
+ 0,
|
||||||
|
+ 0,
|
||||||
|
+ format!("Hashboard {id}: {orange} degraded chip(s)"),
|
||||||
|
+ MessageSeverity::Warning,
|
||||||
|
+ Some(MinerComponent::hashboard(idx)),
|
||||||
|
+ ));
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
messages
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/vendor/asic-rs-firmwares-vnish/src/backends/v1_3_0/mod.rs b/vendor/asic-rs-firmwares-vnish/src/backends/v1_3_0/mod.rs
|
||||||
|
index 4f0453a1..1301a657 100644
|
||||||
|
--- a/vendor/asic-rs-firmwares-vnish/src/backends/v1_3_0/mod.rs
|
||||||
|
+++ b/vendor/asic-rs-firmwares-vnish/src/backends/v1_3_0/mod.rs
|
||||||
|
@@ -20,7 +20,7 @@ use asic_rs_core::{
|
||||||
|
device::DeviceInfo,
|
||||||
|
fan::FanData,
|
||||||
|
hashrate::{HashRate, HashRateUnit},
|
||||||
|
- message::{MessageSeverity, MinerMessage},
|
||||||
|
+ message::{MessageSeverity, MinerComponent, MinerMessage},
|
||||||
|
miner::TuningTarget,
|
||||||
|
operating_state::OperatingState,
|
||||||
|
pool::{PoolData, PoolGroupData, PoolURL},
|
||||||
|
@@ -351,14 +351,26 @@ impl GetDataLocations for VnishV130 {
|
||||||
|
tag: None,
|
||||||
|
},
|
||||||
|
)],
|
||||||
|
- DataField::Messages => vec![(
|
||||||
|
- WEB_SUMMARY,
|
||||||
|
- DataExtractor {
|
||||||
|
- func: get_by_pointer,
|
||||||
|
- key: Some("/miner/miner_status"),
|
||||||
|
- tag: None,
|
||||||
|
- },
|
||||||
|
- )],
|
||||||
|
+ DataField::Messages => vec![
|
||||||
|
+ (
|
||||||
|
+ WEB_SUMMARY,
|
||||||
|
+ DataExtractor {
|
||||||
|
+ func: get_by_pointer,
|
||||||
|
+ key: Some("/miner/miner_status"),
|
||||||
|
+ tag: Some("miner_status"),
|
||||||
|
+ },
|
||||||
|
+ ),
|
||||||
|
+ // Per-hashboard diagnostics (chip status buckets + per-chain state)
|
||||||
|
+ // for per-board fault messages in parse_messages.
|
||||||
|
+ (
|
||||||
|
+ WEB_SUMMARY,
|
||||||
|
+ DataExtractor {
|
||||||
|
+ func: get_by_pointer,
|
||||||
|
+ key: Some("/miner/chains"),
|
||||||
|
+ tag: Some("chains"),
|
||||||
|
+ },
|
||||||
|
+ ),
|
||||||
|
+ ],
|
||||||
|
DataField::TuningPercent => vec![(
|
||||||
|
WEB_SUMMARY,
|
||||||
|
DataExtractor {
|
||||||
|
@@ -805,9 +817,12 @@ impl GetMessages for VnishV130 {
|
||||||
|
/// reported here rather than computed from invented thresholds.
|
||||||
|
fn parse_messages(&self, data: &HashMap<DataField, Value>) -> Vec<MinerMessage> {
|
||||||
|
let mut messages = Vec::new();
|
||||||
|
+ let msg = data.get(&DataField::Messages);
|
||||||
|
|
||||||
|
- if let Some(status) = data.get(&DataField::Messages)
|
||||||
|
- && let Some(state) = status.pointer("/miner_state").and_then(|v| v.as_str())
|
||||||
|
+ // Miner-level state verdict (now under the "miner_status" tag).
|
||||||
|
+ if let Some(state) = msg
|
||||||
|
+ .and_then(|v| v.pointer("/miner_status/miner_state"))
|
||||||
|
+ .and_then(|v| v.as_str())
|
||||||
|
{
|
||||||
|
let normal = matches!(
|
||||||
|
state.to_lowercase().as_str(),
|
||||||
|
@@ -827,6 +842,68 @@ impl GetMessages for VnishV130 {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Per-hashboard faults from the summary chains (round 20 #1). VNish reports
|
||||||
|
+ // per-chip status buckets (`red` = failed, `orange` = degraded, `grey` =
|
||||||
|
+ // healthy) and a per-chain state; attribute each fault to its own board so
|
||||||
|
+ // the Health column reds the right hashboard icon and that icon's tooltip
|
||||||
|
+ // carries the specific fault, instead of everything landing on the miner-
|
||||||
|
+ // level (brain) message. Chain ids are 1-based; board positions are 0-based.
|
||||||
|
+ if let Some(chains) = msg
|
||||||
|
+ .and_then(|v| v.pointer("/chains"))
|
||||||
|
+ .and_then(|v| v.as_array())
|
||||||
|
+ {
|
||||||
|
+ for chain in chains {
|
||||||
|
+ let Some(id) = chain.pointer("/id").and_then(|v| v.as_u64()) else {
|
||||||
|
+ continue;
|
||||||
|
+ };
|
||||||
|
+ let idx = id.saturating_sub(1) as u16;
|
||||||
|
+ let red = chain
|
||||||
|
+ .pointer("/chip_statuses/red")
|
||||||
|
+ .and_then(|v| v.as_u64())
|
||||||
|
+ .unwrap_or(0);
|
||||||
|
+ let orange = chain
|
||||||
|
+ .pointer("/chip_statuses/orange")
|
||||||
|
+ .and_then(|v| v.as_u64())
|
||||||
|
+ .unwrap_or(0);
|
||||||
|
+ let state = chain
|
||||||
|
+ .pointer("/status/state")
|
||||||
|
+ .and_then(|v| v.as_str())
|
||||||
|
+ .unwrap_or("");
|
||||||
|
+ let state_ok = matches!(
|
||||||
|
+ state.to_lowercase().as_str(),
|
||||||
|
+ "" | "mining" | "auto-tuning" | "auto_tuning" | "tuning"
|
||||||
|
+ );
|
||||||
|
+
|
||||||
|
+ if red > 0 {
|
||||||
|
+ messages.push(MinerMessage::with_component(
|
||||||
|
+ 0,
|
||||||
|
+ 0,
|
||||||
|
+ format!("Hashboard {id}: {red} failed chip(s)"),
|
||||||
|
+ MessageSeverity::Error,
|
||||||
|
+ Some(MinerComponent::hashboard(idx)),
|
||||||
|
+ ));
|
||||||
|
+ } else if !state_ok {
|
||||||
|
+ // A board not in a normal state but with no failed chips: report
|
||||||
|
+ // the state itself (e.g. "initializing", "disabled", "stopped").
|
||||||
|
+ messages.push(MinerMessage::with_component(
|
||||||
|
+ 0,
|
||||||
|
+ 0,
|
||||||
|
+ format!("Hashboard {id}: {state}"),
|
||||||
|
+ MessageSeverity::Error,
|
||||||
|
+ Some(MinerComponent::hashboard(idx)),
|
||||||
|
+ ));
|
||||||
|
+ } else if orange > 0 {
|
||||||
|
+ messages.push(MinerMessage::with_component(
|
||||||
|
+ 0,
|
||||||
|
+ 0,
|
||||||
|
+ format!("Hashboard {id}: {orange} degraded chip(s)"),
|
||||||
|
+ MessageSeverity::Warning,
|
||||||
|
+ Some(MinerComponent::hashboard(idx)),
|
||||||
|
+ ));
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
messages
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"$comment":"This file only protects against accidental modifications. It is not a security mechanism and does not protect against malicious changes.","files":{".cargo_vcs_info.json":"de321c89f62a60690ba07d6bb145ac688c6141c458638e68b3ed36b50b8de1f1","Cargo.lock":"5942ec7c9cf5c201bd32442d65020dc3ae72e33cb5aaf374b2a26501571a1487","Cargo.toml":"cb9ee00cbb415fa66a71a7d4822839bb3552336ec9ab975ae7b1137c711449cb","Cargo.toml.orig":"08409c395e4d502015da62e97efdc9c5bc6e3076031144f3f5aa35c900c7c735","src/backends/mod.rs":"26591e67688f8d015242295dde5050c4b34986e9980018a855346291a0472206","src/backends/v1_2_0/mod.rs":"01e6310dbe806f132ac303a2d38e82f41a2973fe7c0f448fbecd0f257b285133","src/backends/v1_2_0/web.rs":"ac89f16bf623f7d85590d34b45c99b0e522d9d434b4c22af7fa8a8a653e09d2e","src/backends/v1_3_0/mod.rs":"679aebc708541973da12934f5597aad4f7178b43bd69329142cee1818d50f8d3","src/backends/v1_3_0/web.rs":"1ec4cbe6bdc26f165d9e54e9bf2aac4c3706357ce4677dc21113710d4a26c3c1","src/firmware.rs":"168eeffaef90cb1525bb2e126e73905b5205d49215437263813e30323f6b7a05","src/lib.rs":"16ea1c0007fa6d6c86c1f83d3ac9cdf065cd9936cd52f35ef89c227397bbc54a","src/timezone.rs":"309bf23de1bdc9126bde5db8dabff0d2c0fea797dbf2630a772a18539838a05e"},"package":"1cb662e56f104c0fe45c8ccdac13f60cbcaad45ac228f939c6ac46ff40335052"}
|
{"$comment":"This file only protects against accidental modifications. It is not a security mechanism and does not protect against malicious changes.","files":{".cargo_vcs_info.json":"de321c89f62a60690ba07d6bb145ac688c6141c458638e68b3ed36b50b8de1f1","Cargo.lock":"5942ec7c9cf5c201bd32442d65020dc3ae72e33cb5aaf374b2a26501571a1487","Cargo.toml":"cb9ee00cbb415fa66a71a7d4822839bb3552336ec9ab975ae7b1137c711449cb","Cargo.toml.orig":"08409c395e4d502015da62e97efdc9c5bc6e3076031144f3f5aa35c900c7c735","src/backends/mod.rs":"26591e67688f8d015242295dde5050c4b34986e9980018a855346291a0472206","src/backends/v1_2_0/mod.rs":"1634197592d962894e330b65a808518734aa26af57f182ea64dca59e3e9eb58b","src/backends/v1_2_0/web.rs":"ac89f16bf623f7d85590d34b45c99b0e522d9d434b4c22af7fa8a8a653e09d2e","src/backends/v1_3_0/mod.rs":"ab0a02f3fe1e6400f07f2bd148cb05e027cfc1e5b1fbfe6f2f01a1dddf78bb51","src/backends/v1_3_0/web.rs":"1ec4cbe6bdc26f165d9e54e9bf2aac4c3706357ce4677dc21113710d4a26c3c1","src/firmware.rs":"168eeffaef90cb1525bb2e126e73905b5205d49215437263813e30323f6b7a05","src/lib.rs":"16ea1c0007fa6d6c86c1f83d3ac9cdf065cd9936cd52f35ef89c227397bbc54a","src/timezone.rs":"309bf23de1bdc9126bde5db8dabff0d2c0fea797dbf2630a772a18539838a05e"},"package":"1cb662e56f104c0fe45c8ccdac13f60cbcaad45ac228f939c6ac46ff40335052"}
|
||||||
+88
-11
@@ -20,7 +20,7 @@ use asic_rs_core::{
|
|||||||
device::DeviceInfo,
|
device::DeviceInfo,
|
||||||
fan::FanData,
|
fan::FanData,
|
||||||
hashrate::{HashRate, HashRateUnit},
|
hashrate::{HashRate, HashRateUnit},
|
||||||
message::{MessageSeverity, MinerMessage},
|
message::{MessageSeverity, MinerComponent, MinerMessage},
|
||||||
miner::TuningTarget,
|
miner::TuningTarget,
|
||||||
operating_state::OperatingState,
|
operating_state::OperatingState,
|
||||||
pool::{PoolData, PoolGroupData, PoolURL},
|
pool::{PoolData, PoolGroupData, PoolURL},
|
||||||
@@ -353,14 +353,26 @@ impl GetDataLocations for VnishV120 {
|
|||||||
tag: None,
|
tag: None,
|
||||||
},
|
},
|
||||||
)],
|
)],
|
||||||
DataField::Messages => vec![(
|
DataField::Messages => vec![
|
||||||
WEB_SUMMARY,
|
(
|
||||||
DataExtractor {
|
WEB_SUMMARY,
|
||||||
func: get_by_pointer,
|
DataExtractor {
|
||||||
key: Some("/miner/miner_status"),
|
func: get_by_pointer,
|
||||||
tag: None,
|
key: Some("/miner/miner_status"),
|
||||||
},
|
tag: Some("miner_status"),
|
||||||
)],
|
},
|
||||||
|
),
|
||||||
|
// Per-hashboard diagnostics (chip status buckets + per-chain state)
|
||||||
|
// for per-board fault messages in parse_messages.
|
||||||
|
(
|
||||||
|
WEB_SUMMARY,
|
||||||
|
DataExtractor {
|
||||||
|
func: get_by_pointer,
|
||||||
|
key: Some("/miner/chains"),
|
||||||
|
tag: Some("chains"),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
DataField::TuningTarget => vec![(
|
DataField::TuningTarget => vec![(
|
||||||
WEB_SETTINGS,
|
WEB_SETTINGS,
|
||||||
DataExtractor {
|
DataExtractor {
|
||||||
@@ -850,9 +862,12 @@ impl GetMessages for VnishV120 {
|
|||||||
/// reported here rather than computed from invented thresholds.
|
/// reported here rather than computed from invented thresholds.
|
||||||
fn parse_messages(&self, data: &HashMap<DataField, Value>) -> Vec<MinerMessage> {
|
fn parse_messages(&self, data: &HashMap<DataField, Value>) -> Vec<MinerMessage> {
|
||||||
let mut messages = Vec::new();
|
let mut messages = Vec::new();
|
||||||
|
let msg = data.get(&DataField::Messages);
|
||||||
|
|
||||||
if let Some(status) = data.get(&DataField::Messages)
|
// Miner-level state verdict (now under the "miner_status" tag).
|
||||||
&& let Some(state) = status.pointer("/miner_state").and_then(|v| v.as_str())
|
if let Some(state) = msg
|
||||||
|
.and_then(|v| v.pointer("/miner_status/miner_state"))
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
{
|
{
|
||||||
let normal = matches!(
|
let normal = matches!(
|
||||||
state.to_lowercase().as_str(),
|
state.to_lowercase().as_str(),
|
||||||
@@ -872,6 +887,68 @@ impl GetMessages for VnishV120 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Per-hashboard faults from the summary chains (round 20 #1). VNish reports
|
||||||
|
// per-chip status buckets (`red` = failed, `orange` = degraded, `grey` =
|
||||||
|
// healthy) and a per-chain state; attribute each fault to its own board so
|
||||||
|
// the Health column reds the right hashboard icon and that icon's tooltip
|
||||||
|
// carries the specific fault, instead of everything landing on the miner-
|
||||||
|
// level (brain) message. Chain ids are 1-based; board positions are 0-based.
|
||||||
|
if let Some(chains) = msg
|
||||||
|
.and_then(|v| v.pointer("/chains"))
|
||||||
|
.and_then(|v| v.as_array())
|
||||||
|
{
|
||||||
|
for chain in chains {
|
||||||
|
let Some(id) = chain.pointer("/id").and_then(|v| v.as_u64()) else {
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
let idx = id.saturating_sub(1) as u16;
|
||||||
|
let red = chain
|
||||||
|
.pointer("/chip_statuses/red")
|
||||||
|
.and_then(|v| v.as_u64())
|
||||||
|
.unwrap_or(0);
|
||||||
|
let orange = chain
|
||||||
|
.pointer("/chip_statuses/orange")
|
||||||
|
.and_then(|v| v.as_u64())
|
||||||
|
.unwrap_or(0);
|
||||||
|
let state = chain
|
||||||
|
.pointer("/status/state")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.unwrap_or("");
|
||||||
|
let state_ok = matches!(
|
||||||
|
state.to_lowercase().as_str(),
|
||||||
|
"" | "mining" | "auto-tuning" | "auto_tuning" | "tuning"
|
||||||
|
);
|
||||||
|
|
||||||
|
if red > 0 {
|
||||||
|
messages.push(MinerMessage::with_component(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
format!("Hashboard {id}: {red} failed chip(s)"),
|
||||||
|
MessageSeverity::Error,
|
||||||
|
Some(MinerComponent::hashboard(idx)),
|
||||||
|
));
|
||||||
|
} else if !state_ok {
|
||||||
|
// A board not in a normal state but with no failed chips: report
|
||||||
|
// the state itself (e.g. "initializing", "disabled", "stopped").
|
||||||
|
messages.push(MinerMessage::with_component(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
format!("Hashboard {id}: {state}"),
|
||||||
|
MessageSeverity::Error,
|
||||||
|
Some(MinerComponent::hashboard(idx)),
|
||||||
|
));
|
||||||
|
} else if orange > 0 {
|
||||||
|
messages.push(MinerMessage::with_component(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
format!("Hashboard {id}: {orange} degraded chip(s)"),
|
||||||
|
MessageSeverity::Warning,
|
||||||
|
Some(MinerComponent::hashboard(idx)),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
messages
|
messages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+88
-11
@@ -20,7 +20,7 @@ use asic_rs_core::{
|
|||||||
device::DeviceInfo,
|
device::DeviceInfo,
|
||||||
fan::FanData,
|
fan::FanData,
|
||||||
hashrate::{HashRate, HashRateUnit},
|
hashrate::{HashRate, HashRateUnit},
|
||||||
message::{MessageSeverity, MinerMessage},
|
message::{MessageSeverity, MinerComponent, MinerMessage},
|
||||||
miner::TuningTarget,
|
miner::TuningTarget,
|
||||||
operating_state::OperatingState,
|
operating_state::OperatingState,
|
||||||
pool::{PoolData, PoolGroupData, PoolURL},
|
pool::{PoolData, PoolGroupData, PoolURL},
|
||||||
@@ -351,14 +351,26 @@ impl GetDataLocations for VnishV130 {
|
|||||||
tag: None,
|
tag: None,
|
||||||
},
|
},
|
||||||
)],
|
)],
|
||||||
DataField::Messages => vec![(
|
DataField::Messages => vec![
|
||||||
WEB_SUMMARY,
|
(
|
||||||
DataExtractor {
|
WEB_SUMMARY,
|
||||||
func: get_by_pointer,
|
DataExtractor {
|
||||||
key: Some("/miner/miner_status"),
|
func: get_by_pointer,
|
||||||
tag: None,
|
key: Some("/miner/miner_status"),
|
||||||
},
|
tag: Some("miner_status"),
|
||||||
)],
|
},
|
||||||
|
),
|
||||||
|
// Per-hashboard diagnostics (chip status buckets + per-chain state)
|
||||||
|
// for per-board fault messages in parse_messages.
|
||||||
|
(
|
||||||
|
WEB_SUMMARY,
|
||||||
|
DataExtractor {
|
||||||
|
func: get_by_pointer,
|
||||||
|
key: Some("/miner/chains"),
|
||||||
|
tag: Some("chains"),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
DataField::TuningPercent => vec![(
|
DataField::TuningPercent => vec![(
|
||||||
WEB_SUMMARY,
|
WEB_SUMMARY,
|
||||||
DataExtractor {
|
DataExtractor {
|
||||||
@@ -805,9 +817,12 @@ impl GetMessages for VnishV130 {
|
|||||||
/// reported here rather than computed from invented thresholds.
|
/// reported here rather than computed from invented thresholds.
|
||||||
fn parse_messages(&self, data: &HashMap<DataField, Value>) -> Vec<MinerMessage> {
|
fn parse_messages(&self, data: &HashMap<DataField, Value>) -> Vec<MinerMessage> {
|
||||||
let mut messages = Vec::new();
|
let mut messages = Vec::new();
|
||||||
|
let msg = data.get(&DataField::Messages);
|
||||||
|
|
||||||
if let Some(status) = data.get(&DataField::Messages)
|
// Miner-level state verdict (now under the "miner_status" tag).
|
||||||
&& let Some(state) = status.pointer("/miner_state").and_then(|v| v.as_str())
|
if let Some(state) = msg
|
||||||
|
.and_then(|v| v.pointer("/miner_status/miner_state"))
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
{
|
{
|
||||||
let normal = matches!(
|
let normal = matches!(
|
||||||
state.to_lowercase().as_str(),
|
state.to_lowercase().as_str(),
|
||||||
@@ -827,6 +842,68 @@ impl GetMessages for VnishV130 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Per-hashboard faults from the summary chains (round 20 #1). VNish reports
|
||||||
|
// per-chip status buckets (`red` = failed, `orange` = degraded, `grey` =
|
||||||
|
// healthy) and a per-chain state; attribute each fault to its own board so
|
||||||
|
// the Health column reds the right hashboard icon and that icon's tooltip
|
||||||
|
// carries the specific fault, instead of everything landing on the miner-
|
||||||
|
// level (brain) message. Chain ids are 1-based; board positions are 0-based.
|
||||||
|
if let Some(chains) = msg
|
||||||
|
.and_then(|v| v.pointer("/chains"))
|
||||||
|
.and_then(|v| v.as_array())
|
||||||
|
{
|
||||||
|
for chain in chains {
|
||||||
|
let Some(id) = chain.pointer("/id").and_then(|v| v.as_u64()) else {
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
let idx = id.saturating_sub(1) as u16;
|
||||||
|
let red = chain
|
||||||
|
.pointer("/chip_statuses/red")
|
||||||
|
.and_then(|v| v.as_u64())
|
||||||
|
.unwrap_or(0);
|
||||||
|
let orange = chain
|
||||||
|
.pointer("/chip_statuses/orange")
|
||||||
|
.and_then(|v| v.as_u64())
|
||||||
|
.unwrap_or(0);
|
||||||
|
let state = chain
|
||||||
|
.pointer("/status/state")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.unwrap_or("");
|
||||||
|
let state_ok = matches!(
|
||||||
|
state.to_lowercase().as_str(),
|
||||||
|
"" | "mining" | "auto-tuning" | "auto_tuning" | "tuning"
|
||||||
|
);
|
||||||
|
|
||||||
|
if red > 0 {
|
||||||
|
messages.push(MinerMessage::with_component(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
format!("Hashboard {id}: {red} failed chip(s)"),
|
||||||
|
MessageSeverity::Error,
|
||||||
|
Some(MinerComponent::hashboard(idx)),
|
||||||
|
));
|
||||||
|
} else if !state_ok {
|
||||||
|
// A board not in a normal state but with no failed chips: report
|
||||||
|
// the state itself (e.g. "initializing", "disabled", "stopped").
|
||||||
|
messages.push(MinerMessage::with_component(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
format!("Hashboard {id}: {state}"),
|
||||||
|
MessageSeverity::Error,
|
||||||
|
Some(MinerComponent::hashboard(idx)),
|
||||||
|
));
|
||||||
|
} else if orange > 0 {
|
||||||
|
messages.push(MinerMessage::with_component(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
format!("Hashboard {id}: {orange} degraded chip(s)"),
|
||||||
|
MessageSeverity::Warning,
|
||||||
|
Some(MinerComponent::hashboard(idx)),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
messages
|
messages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user