Open
Conversation
Add metrics hashrate endpoint that queries miner hashrate data via tailLogCustomRangeAggr RPC and returns daily hashrate with summary.
Add metrics consumption endpoint that queries powermeter data via tailLogCustomRangeAggr RPC and returns daily power/consumption with summary.
Add metrics efficiency endpoint that queries miner efficiency (W/TH) data via tailLogCustomRangeAggr RPC. Adds AGGR_FIELDS.EFFICIENCY constant.
Add miner-status endpoint that queries miner status data via tailLog RPC with aggregated offline/sleep/maintenance counts per day.
This was referenced Feb 19, 2026
…erature endpoints Add three new metrics endpoints with interval-based aggregation, per-miner power mode categorization with status overrides, timeline segmentation, and per-container temperature breakdown with site-wide aggregates.
…ltering Curl testing revealed three bugs: - tailLog with groupRange returns ts as "start-end" string (e.g. "1770854400000-1771459199999"), not a number. getStartOfDay(NaN) silently dropped all entries. Added parseEntryTs() helper. - Container names are not valid RPC tags (returns empty []). Changed to always use tag 't-miner' and post-filter by container in handler. - Pre-existing bug in getMinerStatus: same range-string ts issue with groupRange '1D' caused empty logs. Now fixed.
total_cnt does not exist in stat-3h RPC entries. The online count was always 0 because the total was defaulting to 0. Use type_cnt (object keyed by miner type) with sumObjectValues() to derive the correct total, enabling accurate online = total - offline - sleep - maintenance.
- Extract validateStartEnd(), iterateRpcEntries(), forEachRangeAggrItem() shared helpers to eliminate duplicated validation, result unpacking, and range-aggr processing across 7 endpoints - Add TYPE_CNT, OFFLINE_CNT, SLEEP_CNT, MAINTENANCE_CNT to AGGR_FIELDS constants replacing hardcoded strings in miner-status handler - Use proper weighted running average for temperature merging across orks - Extract DEFAULT_TIMELINE_LIMIT constant and extractContainerFromMinerId() - Unify entry.error checks and parseEntryTs usage across all endpoints
tekwani
reviewed
Feb 23, 2026
paragmore
reviewed
Feb 23, 2026
paragmore
reviewed
Feb 23, 2026
paragmore
reviewed
Feb 23, 2026
paragmore
reviewed
Feb 23, 2026
paragmore
reviewed
Feb 23, 2026
paragmore
reviewed
Feb 23, 2026
paragmore
reviewed
Feb 23, 2026
tekwani
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /auth/metrics/*API v2 endpoints ported from the legacy dashboard, replacing frontendtail-log/tail-log/range-aggrcalls with clean REST APIs{ log: [...], summary: {...} }response format consistent with finance endpoints1h/1d/1wbased on date range)groupRange: '1D'/'1W')type_cntfieldEndpoints
GET /auth/metrics/hashrate — daily hashrate (MH/s) with summary averages via
tailLogCustomRangeAggrRPCGET /auth/metrics/hashrate?start=1700000000000&end=1700100000000&overwriteCache=trueGET /auth/metrics/consumption — daily power consumption (W + MWh) via
tailLogCustomRangeAggrRPCGET /auth/metrics/consumption?start=1700000000000&end=1700100000000&overwriteCache=trueGET /auth/metrics/efficiency — daily efficiency (W/TH/s) via
tailLogCustomRangeAggrRPCGET /auth/metrics/efficiency?start=1700000000000&end=1700100000000&overwriteCache=trueGET /auth/metrics/miner-status — daily miner status breakdown (online/offline/sleep/maintenance) via
tailLogRPCGET /auth/metrics/miner-status?start=1700000000000&end=1700100000000&overwriteCache=trueGET /auth/metrics/power-mode — miner power mode distribution over time via
tailLogRPCGET /auth/metrics/power-mode?start=1700000000000&end=1700100000000&interval=1d&overwriteCache=trueOptional: interval ("1h" | "1d" | "1w"), overwriteCache
GET /auth/metrics/power-mode/timeline — per-miner power mode timeline with merged segments via
tailLogRPCGET /auth/metrics/power-mode/timeline?start=1700000000000&end=1700100000000&container=bitdeer-9a&limit=10080&overwriteCache=trueOptional: start, end, container, limit, overwriteCache
GET /auth/metrics/temperature — per-container temperature breakdown with site-wide aggregates via
tailLogRPCGET /auth/metrics/temperature?start=1700000000000&end=1700100000000&interval=1d&container=bitdeer-9a&overwriteCache=trueOptional: interval ("1h" | "1d" | "1w"), container, overwriteCache
Known Issues
stat-3hentries. Selecting1hinterval returns raw 3h data points, not true 1-hour resolution.