[Bug]: Too much data generated by default when polling `/emissions/bylocation` endpoint
See original GitHub issueContact Details
GitHub/Slack: Willmish
What happened?
- When calling GET on the
/emissions/bylocation
endpoint, and only providing Location and not a time frame, by default the SDK requests data for a 7 days in 5 minute intervals (hundreds of data). - When calling the endpoints with the same
time
andtoTime
, SDK will respond with 2 values: beforetime
and aftertoTime
This doesn’t seem like a healthy default for the SDK.
Instead, I suggest:
- the SDK by default asks for 20-50 data points in 5 minute intervals, going from most recent to a few hours before current time.
- SDK should not give values after
toTime
, only up to - this way we will also receive a single value whentime
is the same astoTime
Example Swagger UI query which produces a lot of data:
client
WebAPI (Default)
Relevant log output
No response
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created a year ago
- Comments:20 (18 by maintainers)
Top Results From Across the Web
Celebrating 100 years of innovation
In pursuit of our purpose, we work together with our many OEM customers and suppliers around the globe to design, develop, manufacture and ......
Read more >NOTE TO USERS
In this research study, a set of tools was developed to predict vehicle emissions in. Canada's National Capital Region using output from the...
Read more >Enel Chile Sustainability Report 2022
Sustainability Report Enel Chile 2022. 1. Letter to stakeholders. Our commitment to sustainability. 2. Materiality analysis. Letter to stakeholders.
Read more >Author: admin
Criado-Perez points out 'seeing men as the human default is fundamental to the structure of human society' and she provides lots of data...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @NickVilimek sorry for the delay.
I agree with you that if someone provides a start AND end time, then it should calculate and override the default limit.
My thoughts were (especially for new people using this) not to be overwhelmed by results. So I would have expected that we could have some default values:
So for example for different scenarios (with at least location):
(Generally, I would say start time, end time and interval would be priority over to override nb or results if that makes sense)
@NickVilimek does that make sense, and would that be ok? ( I believe the default value of less than zero is important to ensure we can do this as low level as possible so it applies across CLI and WebAPI, no?)
Let me know if above is not clear enough or misses key scenarios…
Closed and merged.