Open sevenzing opened 2 months ago
Caveat: chart "ActiveAccounts". Adding intervals requires us to calculate/store unique users for each interval. It's quite non-trivial. Also not really clear what to do with cumulative/increasing graphs. Show result at the start/middle/end of the interval, or even an average value.
Almost forgot: graphs with averages are non-trivial as well. To properly compute an average of some interval from averages of subintervals we need to retrieve # of entries for each subinterval.
I.e. we have 100 entries on monday (avg=0.5) and 1 entry on friday (avg=1). Avg for the week should be ~0.5 instead of 0.75
for now will implement it for easier cases, let's decide on "ActiveAccounts" later..
Also not really clear what to do with cumulative/increasing graphs. Show result at the start/middle/end of the interval, or even an average value.
and for this it makes sense to let it be configurable (i.e. also decide later)
Add a parameter to query string (enum => string with some set of available values). Variants:
Pros:
Cons:
..&resolution=3months
looks weird) - minor, seems okResponse API remains the same:
{
"chart": [
{
"date": "2024-07-01",
"value": "35607"
},
{
"date": "2024-07-02",
"value": "8832",
"is_approximate": true
}
]
}
and for resolutions the end(or middle or start) of each interval is returned. I.e. for month
it may return the last date of each month.
Maybe we can add this info for each chart separately (e.g. in /lines
endpoint or as in #913)
Pros:
Add date_to
or date_from
field
{
"chart": [
{
"date": "2024-06-01",
"date_to": "2024-06-30",
"value": "35607"
},
{
"date": "2024-07-01",
"date_to": "2024-07-31",
"value": "8832",
"is_approximate": true
}
]
}
Pros:
date
to date_from
? (will be backwards-incompatible - bad ig)some other rejected variants:
Add new input to stats page (like interval) called "resolution" to return results for a single day, a week, a month, or a year:
most likely it will change api, or at least
date
key in responseRefactor the service in preparation for feature:
Implement resolutions:
Week
data type