From 3e6985cb4e9ef7f6b04c26a95287ebceefe08e88 Mon Sep 17 00:00:00 2001 From: Rob Thijssen Date: Fri, 4 Sep 2026 08:50:53 +0300 Subject: [PATCH] dashboard: leaderboard gains est. hashrate, gap p10, drift median and consecutive columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Estimated hashrate is the author's share of blocks over the range times the network hashrate estimate: statistical, roughly ±10% at a few hundred blocks, and labelled as such. The timing columns join the new per-author histograms (lair/quantus#12) on the preimage; outer join filtered to the top-20 rows from the blocks query so authors without timing data still appear with blanks. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01CBgs2nSi4H2mdh8kD8vMX5 --- asset/grafana/quantus.json | 171 +++++++++++++++++++++++++++++++++++-- 1 file changed, 165 insertions(+), 6 deletions(-) diff --git a/asset/grafana/quantus.json b/asset/grafana/quantus.json index a1d6064..b7fc524 100644 --- a/asset/grafana/quantus.json +++ b/asset/grafana/quantus.json @@ -9,7 +9,7 @@ ], "timezone": "browser", "schemaVersion": 39, - "version": 13, + "version": 14, "refresh": "30s", "time": { "from": "now-6h", @@ -1716,7 +1716,7 @@ "x": 0, "y": 62 }, - "description": "Blocks observed authored within the selected time range, by reward preimage, from the cumulative counter quantus_blocks_authored_total. Counts exist from the moment the exporter started exporting it and within Prometheus retention; increase() extrapolates across scrape gaps, so treat the last digit as approximate. The fixed 3600-block window is quantus_blocks_authored.", + "description": "Blocks observed authored within the selected time range, by reward preimage (cumulative counter, exists from the exporter's restart onward). est. MH/s is the author's share of blocks times the network hashrate estimate over the range: a statistical figure, \u00b110% or so at a few hundred blocks. gap p10: the 10th percentile of seconds between the author's block and the previous one; near zero means blocks released right after others' (withheld). drift median: the author's block timestamp minus when we first saw it; a few seconds negative is normal, positive is future-dated. consecutive: blocks authored directly after the author's own previous block. Timing columns fill in from when the exporter started recording them.", "targets": [ { "datasource": { @@ -1729,28 +1729,123 @@ "instant": true, "range": false, "format": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "refId": "B", + "expr": "increase(quantus_blocks_authored_total[$__range]) / scalar(sum(increase(quantus_blocks_authored_total[$__range]))) * scalar(avg_over_time(quantus_network_hashrate[$__range])) / 1e6", + "instant": true, + "range": false, + "format": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "refId": "C", + "expr": "histogram_quantile(0.1, sum by (preimage, le) (increase(quantus_block_gap_seconds_bucket{preimage!~\"all|other\"}[$__range])))", + "instant": true, + "range": false, + "format": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "refId": "D", + "expr": "histogram_quantile(0.5, sum by (preimage, le) (increase(quantus_block_timestamp_drift_seconds_bucket{preimage!~\"all|other\"}[$__range])))", + "instant": true, + "range": false, + "format": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "refId": "E", + "expr": "sum by (preimage) (increase(quantus_consecutive_self_blocks_total{preimage!=\"other\"}[$__range]))", + "instant": true, + "range": false, + "format": "table" } ], "transformations": [ + { + "id": "joinByField", + "options": { + "byField": "preimage", + "mode": "outer" + } + }, + { + "id": "filterByValue", + "options": { + "filters": [ + { + "fieldName": "Value #A", + "config": { + "id": "isNotNull", + "options": {} + } + } + ], + "type": "include", + "match": "all" + } + }, { "id": "organize", "options": { "excludeByName": { "Time": true, + "Time 1": true, + "Time 2": true, + "Time 3": true, + "Time 4": true, + "Time 5": true, "__name__": true, + "__name__ 1": true, + "__name__ 2": true, "job": true, + "job 1": true, + "job 2": true, "instance": true, - "component": true + "instance 1": true, + "instance 2": true, + "component": true, + "component 1": true, + "component 2": true, + "self 2": true }, "renameByName": { - "Value": "blocks", "preimage": "reward preimage", - "self": "ours" + "self": "ours", + "self 1": "ours", + "Value #A": "blocks", + "Value #B": "est. MH/s", + "Value #C": "gap p10 (s)", + "Value #D": "drift median (s)", + "Value #E": "consecutive" }, "indexByName": { "preimage": 0, "self": 1, - "Value": 2 + "self 1": 1, + "Value #A": 2, + "Value #B": 3, + "Value #C": 4, + "Value #D": 5, + "Value #E": 6 } } }, @@ -1854,6 +1949,70 @@ "value": 620 } ] + }, + { + "matcher": { + "id": "byName", + "options": "est. MH/s" + }, + "properties": [ + { + "id": "decimals", + "value": 0 + }, + { + "id": "unit", + "value": "none" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "gap p10 (s)" + }, + "properties": [ + { + "id": "decimals", + "value": 1 + }, + { + "id": "unit", + "value": "none" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "drift median (s)" + }, + "properties": [ + { + "id": "decimals", + "value": 1 + }, + { + "id": "unit", + "value": "none" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "consecutive" + }, + "properties": [ + { + "id": "decimals", + "value": 0 + }, + { + "id": "unit", + "value": "none" + } + ] } ] }, -- 2.52.0