fix: processTailLogData drills into .val for nested TAIL_LOG_RANGE_AGGR#65
Closed
mukama wants to merge 1 commit intotetherto:developfrom
Closed
fix: processTailLogData drills into .val for nested TAIL_LOG_RANGE_AGGR#65mukama wants to merge 1 commit intotetherto:developfrom
mukama wants to merge 1 commit intotetherto:developfrom
Conversation
The TAIL_LOG_RANGE_AGGR RPC returns per-day items as
{ts, val: {site_power_w, hashrate_mhs_5m_sum_aggr}}, but
processTailLogData read item[AGGR_FIELDS.SITE_POWER] directly without
drilling into .val, so powerW and hashrateMhs were 0 for every entry.
RevenueSummary then showed 0 for Avg Power, Avg Hashrate, and Hashrate
Capacity Factor; EBITDA's per-day power/hashrate were similarly zeroed.
Mirror the .val/.flat fallback pattern that processConsumptionData
already uses (workers/lib/server/handlers/finance.handlers.js:172).
Contributor
Author
|
Consolidated into #67. |
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
Fixes Bug A from the FE refactor smoke test:
processTailLogDatareaditem[AGGR_FIELDS.SITE_POWER]directly, but the production response wraps measurements as{ts, val: {site_power_w, hashrate_mhs_5m_sum_aggr}}. Result:powerWandhashrateMhswere 0 for every log entry, so RevenueSummary showed 0 for Avg Power / Avg Hashrate / Hashrate Capacity Factor (and EBITDA's per-day power/hashrate were similarly zeroed). Mirror the.val || itemfallback pattern thatprocessConsumptionDataalready uses on line 172.Asana: https://app.asana.com/1/45238840754660/project/1205537444723387/task/1214118019754311
Test plan
standardlint cleandev-moria.tether.to/auth/tail-log/range-aggr— fixedprocessTailLogDataproduces 59 days with non-zeropowerW(478.9 MW) andhashrateMhs(18.13 EH/s) from the real production response. Pre-fix returned 0 for both fields on every day.dev-moriaonce deployed: RevenueSummary renders real Avg Power / Avg Hashrate / Hashrate Capacity Factor.