From 270ee55bd66274cdb60506f0c08041ff2c45c43f Mon Sep 17 00:00:00 2001 From: Rob Thijssen Date: Fri, 4 Sep 2026 10:59:46 +0300 Subject: [PATCH] grafana: per-author hashrate window follows the dashboard range New interval variable 'author window' (auto: about a quarter of the range, never under 2 h; or pinned 1h..2d) replaces the fixed 6 h trailing window in the hashrate-by-author panel, so a week view smooths and a short view resolves. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01CBgs2nSi4H2mdh8kD8vMX5 --- asset/grafana/quantus.json | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/asset/grafana/quantus.json b/asset/grafana/quantus.json index be70281..ca975d6 100644 --- a/asset/grafana/quantus.json +++ b/asset/grafana/quantus.json @@ -9,7 +9,7 @@ ], "timezone": "browser", "schemaVersion": 39, - "version": 22, + "version": 23, "refresh": "30s", "time": { "from": "now-6h", @@ -2312,7 +2312,7 @@ }, { "type": "timeseries", - "title": "Hashrate by author (6 h share of blocks \u00d7 network hashrate)", + "title": "Hashrate by author ($window share of blocks \u00d7 network hashrate)", "datasource": { "type": "prometheus", "uid": "prometheus" @@ -2323,7 +2323,7 @@ "x": 0, "y": 72 }, - "description": "Each author's estimated hashrate over time: its share of the blocks authored in the trailing 6 h times the network hashrate averaged over the same 6 h, in MH/s. Authors below 10 MH/s are left out. The legend uses the telemetry node name where the arena exporter has attributed the preimage, else the abbreviated preimage; an author gets a new line when its label changes. Pools grow by headcount, so a steadily rising line with no step is a pool filling up; a step is hardware arriving or leaving. 6 h of blocks is about 1800, so a 3% author's line carries roughly \u00b115% sampling noise.", + "description": "Each author's estimated hashrate over time: its share of the blocks authored in the trailing window times the network hashrate averaged over the same window, in MH/s. Authors below 10 MH/s are left out. The legend uses the telemetry node name where the arena exporter has attributed the preimage, else the abbreviated preimage; an author gets a new line when its label changes. Pools grow by headcount, so a steadily rising line with no step is a pool filling up; a step is hardware arriving or leaving. The window follows the dashboard range on auto (about a quarter of it, never under 2 h) and can be pinned with the 'author window' selector; 6 h is about 1800 blocks, at which a 3% author's line carries roughly \u00b115% sampling noise, 2 h roughly \u00b125%.", "targets": [ { "datasource": { @@ -2332,7 +2332,7 @@ }, "editorMode": "code", "refId": "A", - "expr": "(((increase(quantus_blocks_authored_total[6h]) / scalar(sum(increase(quantus_blocks_authored_total[6h]))) * scalar(avg_over_time(quantus_network_hashrate[6h])) / 1e6) * on (preimage) group_left(display) quantus_author_node_info) or label_replace((increase(quantus_blocks_authored_total[6h]) / scalar(sum(increase(quantus_blocks_authored_total[6h]))) * scalar(avg_over_time(quantus_network_hashrate[6h])) / 1e6) unless on (preimage) quantus_author_node_info, \"display\", \"$1\u2026$2\", \"preimage\", \"^(0x[0-9a-f]{6})[0-9a-f]*([0-9a-f]{4})$\")) > 10", + "expr": "(((increase(quantus_blocks_authored_total[$window]) / scalar(sum(increase(quantus_blocks_authored_total[$window]))) * scalar(avg_over_time(quantus_network_hashrate[$window])) / 1e6) * on (preimage) group_left(display) quantus_author_node_info) or label_replace((increase(quantus_blocks_authored_total[$window]) / scalar(sum(increase(quantus_blocks_authored_total[$window]))) * scalar(avg_over_time(quantus_network_hashrate[$window])) / 1e6) unless on (preimage) quantus_author_node_info, \"display\", \"$1\u2026$2\", \"preimage\", \"^(0x[0-9a-f]{6})[0-9a-f]*([0-9a-f]{4})$\")) > 10", "legendFormat": "{{display}}", "range": true } @@ -3916,5 +3916,27 @@ "step": "1m" } ] + }, + "templating": { + "list": [ + { + "type": "interval", + "name": "window", + "label": "author window", + "description": "Trailing window for the per-author hashrate estimate. Auto follows the dashboard range (about a quarter of it, never under 2 h); 300 blocks an hour, so a 3% author has roughly \u00b124% sampling noise at 2 h and \u00b114% at 6 h.", + "query": "1h,2h,3h,6h,12h,24h,2d", + "options": [], + "current": { + "text": "auto", + "value": "$__auto" + }, + "auto": true, + "auto_count": 4, + "auto_min": "2h", + "refresh": 2, + "hide": 0, + "skipUrlSync": false + } + ] } } -- 2.52.0