-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pacific Power Recent Data GET Endpoint #309
Conversation
Misc ResearchEDIT: 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
==== Code ChangesI 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). Local backend testing screenshotsTODO
|
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and works as expected.
Follow-up task (future PR): OSU-Sustainability-Office/automated-jobs#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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, both of the new endpoints are working as expected.
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