Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8deecf3558 | ||
|
|
3a6a190ce1 | ||
|
|
1f0a4cbe76 | ||
|
|
fbc43216fb |
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"bench_parse_line_near_max_addrs": 2827876.0,
|
||||
"bench_parse_targets_many_ranges_near_cap": 212629393.0,
|
||||
"bench_render_cells": 20754823.0,
|
||||
"bench_sort_by_each_column": 2044409.0,
|
||||
"bench_targets_to_cidrs_large_range": 2702478.0,
|
||||
"bench_upsert_cold_start_population": 63442076.0,
|
||||
"bench_view_pipeline": 785884.0,
|
||||
"bench_view_pipeline_default_sort": 1696098.0,
|
||||
"bench_view_pipeline_with_filter": 1122175.0
|
||||
"bench_parse_line_near_max_addrs": 5695489.0,
|
||||
"bench_parse_targets_many_ranges_near_cap": 191917212.0,
|
||||
"bench_render_cells": 18308797.0,
|
||||
"bench_sort_by_each_column": 3640355.0,
|
||||
"bench_targets_to_cidrs_large_range": 2033018.0,
|
||||
"bench_upsert_cold_start_population": 55612455.0,
|
||||
"bench_view_pipeline": 678730.0,
|
||||
"bench_view_pipeline_default_sort": 1194398.0,
|
||||
"bench_view_pipeline_with_filter": 1310830.0
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="147.5" height="20" role="img" aria-label="bench: +14.4% vs prev">
|
||||
<title>bench: +14.4% vs prev</title>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="147.5" height="20" role="img" aria-label="bench: -19.6% vs prev">
|
||||
<title>bench: -19.6% vs prev</title>
|
||||
<linearGradient id="s" x2="0" y2="100%">
|
||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||
<stop offset="1" stop-opacity=".1"/>
|
||||
@@ -7,13 +7,13 @@
|
||||
<clipPath id="r"><rect width="147.5" height="20" rx="3" fill="#fff"/></clipPath>
|
||||
<g clip-path="url(#r)">
|
||||
<rect width="44.5" height="20" fill="#555"/>
|
||||
<rect x="44.5" width="103.0" height="20" fill="#fe7d37"/>
|
||||
<rect x="44.5" width="103.0" height="20" fill="#4c1"/>
|
||||
<rect width="147.5" height="20" fill="url(#s)"/>
|
||||
</g>
|
||||
<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="14">bench</text>
|
||||
<text x="96.0" y="15" fill="#010101" fill-opacity=".3">+14.4% vs prev</text>
|
||||
<text x="96.0" y="14">+14.4% vs prev</text>
|
||||
<text x="96.0" y="15" fill="#010101" fill-opacity=".3">-19.6% vs prev</text>
|
||||
<text x="96.0" y="14">-19.6% vs prev</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 955 B After Width: | Height: | Size: 952 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: 44%">
|
||||
<title>coverage: 44%</title>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="95.5" height="20" role="img" aria-label="coverage: 43%">
|
||||
<title>coverage: 43%</title>
|
||||
<linearGradient id="s" x2="0" y2="100%">
|
||||
<stop offset="0" stop-color="#bbb" 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">
|
||||
<text x="32.0" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
||||
<text x="32.0" y="14">coverage</text>
|
||||
<text x="79.8" y="15" fill="#010101" fill-opacity=".3">44%</text>
|
||||
<text x="79.8" y="14">44%</text>
|
||||
<text x="79.8" y="15" fill="#010101" fill-opacity=".3">43%</text>
|
||||
<text x="79.8" y="14">43%</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
@@ -1046,8 +1046,20 @@ impl MinerRow {
|
||||
/// counted as operator-paused when it is not currently mining and its raw
|
||||
/// operating-state string says so (case-insensitively), shared by the live
|
||||
/// 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 {
|
||||
!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
|
||||
@@ -3020,8 +3032,16 @@ mod tests {
|
||||
fn is_paused_detection() {
|
||||
assert!(is_paused("Paused", 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("Error", false), "a failure is broken, not paused");
|
||||
assert!(!is_paused("Idling", false), "plain idle is not an explicit halt");
|
||||
assert!(!is_paused("", false));
|
||||
}
|
||||
|
||||
|
||||
+18
-13
@@ -439,27 +439,32 @@ fn encode_component_health(
|
||||
max_boards: usize,
|
||||
) -> String {
|
||||
let mut segs: Vec<Segment> = Vec::new();
|
||||
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()));
|
||||
// A paused/stopped miner is intentionally halted, not broken: every component
|
||||
// it reports as idle (power off, fans spun down, boards not hashing) is
|
||||
// expected, not a fault, so colour each one blue instead of its red/amber
|
||||
// health colour -- otherwise a paused miner reads as broken (round 19 #19,
|
||||
// extended: originally boards only, but idle fans/power still showed red).
|
||||
// A genuinely undetected component (Unreachable) stays grey: even when paused,
|
||||
// "not present" is not "paused".
|
||||
let col = |h: crate::model::CompHealth| {
|
||||
if r.paused && h != crate::model::CompHealth::Unreachable {
|
||||
pal.accent
|
||||
} else {
|
||||
health_color(pal, h)
|
||||
}
|
||||
};
|
||||
segs.push((Some(col(r.power_health())), SHAPE_BOLT.to_string()));
|
||||
segs.push((Some(col(r.control_health())), SHAPE_BRAIN.to_string()));
|
||||
let fans = r.fan_healths();
|
||||
for h in &fans {
|
||||
segs.push((Some(health_color(pal, *h)), SHAPE_FAN.to_string()));
|
||||
segs.push((Some(col(*h)), SHAPE_FAN.to_string()));
|
||||
}
|
||||
for _ in fans.len()..max_fans {
|
||||
segs.push((None, SHAPE_GAP.to_string()));
|
||||
}
|
||||
let boards = r.board_healths();
|
||||
for h in &boards {
|
||||
// A paused miner's boards are intentionally idle, not faulty: show every
|
||||
// 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()));
|
||||
segs.push((Some(col(*h)), SHAPE_CHIP.to_string()));
|
||||
}
|
||||
for _ in boards.len()..max_boards {
|
||||
segs.push((None, SHAPE_GAP.to_string()));
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
Subject: [PATCH 0005] health tooltips: convert tip area to widget coordinates
|
||||
|
||||
Round 19 #2 (the real fix). The GtkTreeView "query-tooltip" handler for the Health
|
||||
column set a per-icon tip area from gtk_tree_view_get_cell_area, whose rectangle is
|
||||
in BIN-WINDOW coordinates, but gtk_tooltip_set_tip_area expects WIDGET coordinates.
|
||||
The area was therefore offset upward by the column-header height, so it did not
|
||||
contain the pointer -- and GTK suppresses a tooltip whose tip area excludes the
|
||||
cursor. That is why the health icon tooltips never appeared, while the Errors column
|
||||
(which sets no tip area) worked. Convert the slot rectangle back to widget
|
||||
coordinates with gtk_tree_view_convert_bin_window_to_widget_coords before setting it.
|
||||
|
||||
diff --git a/cpp_src/widgets_bridge.cpp b/cpp_src/widgets_bridge.cpp
|
||||
index ba9f1c04..6d09ccb7 100644
|
||||
--- a/cpp_src/widgets_bridge.cpp
|
||||
+++ b/cpp_src/widgets_bridge.cpp
|
||||
@@ -1019,9 +1019,21 @@ static gboolean dvlc_query_tooltip(GtkWidget* tv, gint x, gint y, gboolean keybo
|
||||
// or moves the tooltip as the pointer crosses from one icon to the next -- the
|
||||
// old tooltip just stays put with stale text. Setting a per-slot area makes GTK
|
||||
// hide + re-show + reposition the tooltip for each icon.
|
||||
+ //
|
||||
+ // CRITICAL (round 19 #2, the reason the health tooltips never showed): the slot
|
||||
+ // geometry above (block_left, crect) is in BIN-WINDOW coordinates (what
|
||||
+ // gtk_tree_view_get_cell_area and get_path_at_pos use), but
|
||||
+ // gtk_tooltip_set_tip_area expects WIDGET coordinates. Feeding it bin-window
|
||||
+ // coords offsets the area upward by the header height, so it does not contain
|
||||
+ // the pointer -- and GTK then suppresses the tooltip entirely (it only shows a
|
||||
+ // tooltip whose tip area contains the cursor). The Errors column worked because
|
||||
+ // it sets no tip area. Convert the slot rect back to widget coordinates.
|
||||
+ gint area_wx = 0, area_wy = 0;
|
||||
+ gtk_tree_view_convert_bin_window_to_widget_coords(
|
||||
+ GTK_TREE_VIEW(tv), block_left + slot * adv, crect.y, &area_wx, &area_wy);
|
||||
GdkRectangle area;
|
||||
- area.x = block_left + slot * adv;
|
||||
- area.y = crect.y;
|
||||
+ area.x = area_wx;
|
||||
+ area.y = area_wy;
|
||||
area.width = adv;
|
||||
area.height = crect.height;
|
||||
gtk_tooltip_set_tip_area(tooltip, &area);
|
||||
@@ -1019,9 +1019,21 @@ static gboolean dvlc_query_tooltip(GtkWidget* tv, gint x, gint y, gboolean keybo
|
||||
// or moves the tooltip as the pointer crosses from one icon to the next -- the
|
||||
// old tooltip just stays put with stale text. Setting a per-slot area makes GTK
|
||||
// hide + re-show + reposition the tooltip for each icon.
|
||||
//
|
||||
// CRITICAL (round 19 #2, the reason the health tooltips never showed): the slot
|
||||
// geometry above (block_left, crect) is in BIN-WINDOW coordinates (what
|
||||
// gtk_tree_view_get_cell_area and get_path_at_pos use), but
|
||||
// gtk_tooltip_set_tip_area expects WIDGET coordinates. Feeding it bin-window
|
||||
// coords offsets the area upward by the header height, so it does not contain
|
||||
// the pointer -- and GTK then suppresses the tooltip entirely (it only shows a
|
||||
// tooltip whose tip area contains the cursor). The Errors column worked because
|
||||
// it sets no tip area. Convert the slot rect back to widget coordinates.
|
||||
gint area_wx = 0, area_wy = 0;
|
||||
gtk_tree_view_convert_bin_window_to_widget_coords(
|
||||
GTK_TREE_VIEW(tv), block_left + slot * adv, crect.y, &area_wx, &area_wy);
|
||||
GdkRectangle area;
|
||||
area.x = block_left + slot * adv;
|
||||
area.y = crect.y;
|
||||
area.x = area_wx;
|
||||
area.y = area_wy;
|
||||
area.width = adv;
|
||||
area.height = crect.height;
|
||||
gtk_tooltip_set_tip_area(tooltip, &area);
|
||||
|
||||
Reference in New Issue
Block a user