Closed solderq35 closed 2 months ago
EDIT: I couldn't find any gaps (so far) in PacificPower meters data bigger than 1 day at a time of missed uploads (since the data seems to consistently show up on PacificPower, just up to 24 hours late for the latest upload)
Even in cases where the item number changed (replacement meter?), the gap was one day at most
Conclusion: 7 days is probably overkill, probably like 2 days timeframe is enough
Item #327
, Meter #78163731
Item #160
, Meter #78163731
====
I tried extending the time window from 3 to 7 days as a test, and the performance didn't seem that much worse (maybe about 1.5 to 2x slower at worst, and still faster than the allbuildings API endpoint).
pprecent endpoint, 3 days time window (Duration: 445 ms)
pprecent endpoint, 7 days time window (Duration: 642 ms)
allbuildings endpoint (Duration: 940 ms)
Marking this as ready for review. Think I will keep the 7 day timeframe because there were cases where the data was out of date for 2 days or more for one reason or another, and I have updated my missing data webscraper PR to check for up to 7 days prior via while loops
Follow-up task (future PR): https://github.com/OSU-Sustainability-Office/automated-jobs/issues/51
Updated to list data from past 7 days per meter. Duplicate values (same meter ID + time stamp as an existing value) are skipped
Also, upload with same meter ID + time stamp as an existing value now returns 400 error
Fixed merge errors from exclusion energy dashboard PR, will fix merge errors for automated-jobs repo later
Related Issue
Changes
SQL code (
backend\dependencies\nodejs\models\pacific_power_data.js
)JS Code (
backend\dependencies\nodejs\models\pacific_power_data.js
)Testing
sam local start-api
from backend directory)TODO