EIDA / eida-statistics

Aggregated statistics of EIDA nodes
GNU General Public License v3.0
0 stars 0 forks source link

Change parameter aggregate_on #29

Closed jschaeff closed 1 year ago

jschaeff commented 1 year ago

On /public and /restricted methods, change aggregate_on to:

level

details

Will show the details of the query. Possible values are:

multiple values are allowed. If month and year are specified, reply 400 and a nice detail.

vpet98 commented 1 year ago

Maybe having input time parameters in months and specifying year in details isn't the best idea. What should be the result if start=2022-10 & end=2023-02? Two rows, the first one with the last few months of 2022 and the second with the first few months of 2023?

Maybe I should force the user specifying something like start=YYYY-01 and end=YYYY-12 in end whenever they ask for year in detail?

jschaeff commented 1 year ago

Good point. I think we should not change the parametes the user makes in input dynamically. We should always respect what the user asked for. If she wants to sum up 6 month, she would request start=2022-06&details=year

I would say it's up to the user to be careful with their requests.

The tricky part is to show the user the correct enddate of her result. It could be a key/value in the json respnse ? Instead of date="2022-03" have : startdate="2022-03-01",enddate="2022-03-31" ?

@javiquinte any comment ?

javiquinte commented 1 year ago

I fully support the idea from @jschaeff . If the user requests to sum up some months and aggregate the result as full years it's his/her responsibility. I don't understand the last point (The tricky part...). Could you @vpet98 show the output of the example described by @jschaeff ?

vpet98 commented 1 year ago

Right now, each json of the response contains a month field, like month="2023-05" if it refers to a specific month or month="*" if no details on month are requested.

vpet98 commented 1 year ago

What about having a month/year field in the results? E.g. if details=month: month/year="2022-05". E.g. if details=year: month/year="2022".

jschaeff commented 1 year ago

Keeping the same field name for both details makes sense.

But month/year is kind of ugly.

What about date simply ?

vpet98 commented 1 year ago

I think this issue is completed! Let's leave it open for a couple of days in case someone wants to suggest any change.