Skip to content

feat: align site/status/live with header UI logic#93

Merged
mukama merged 1 commit into
tetherto:developfrom
paragmore:feat/site-status-live-api
Jun 13, 2026
Merged

feat: align site/status/live with header UI logic#93
mukama merged 1 commit into
tetherto:developfrom
paragmore:feat/site-status-live-api

Conversation

@paragmore

Copy link
Copy Markdown
Contributor

Aligns the /site/status/live endpoint with the header UI's data orchestration so the UI can switch to a single backend call.

Changes

  • Source site consumption by featureConfig, mirroring the UI: central DCS site_main meter → totalSystemConsumptionHeader (0) → totalTransformerConsumptionHeader (transformer meters) → default site power meter. Expose power.alert/power.error from the site meter alerts.
  • Fix minerpool ext-data parsing (stats is an array, one entry per pool) and convert pool hashrate from H/s to MH/s.
  • Sum alerts across miner, powermeter and container entries.
  • Limit the tail-log query to a 10 minute freshness window.
  • Drop the derived miners.sleep field; add unit metadata (MH/s, W, W/TH/s) to response fields.
  • Extract aggregation/compose helpers into site.utils.js and move related constants.

Testing

  • tests/unit/handlers/site.handlers.test.js and tests/integration/api.test.js updated and passing.

- source consumption by featureConfig (DCS site_main meter, transformer
  meters, or site power meter) and expose power alert/error
- fix minerpool stats parsing and convert pool hashrate to MH/s
- sum alerts across miner, powermeter and container entries
- limit tail-log query to a 10 minute freshness window
- drop derived miners.sleep, add unit metadata to response fields
- extract aggregation helpers to site.utils.js
@mukama mukama merged commit af9c55c into tetherto:develop Jun 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants