webcompat / webcompat-metrics-server

Server in charge of delivering different data to the webcompat-metrics-client
Mozilla Public License 2.0
6 stars 5 forks source link

When date range is inferior to the sampling range, get the min-max values on both sides #76

Open karlcow opened 5 years ago

karlcow commented 5 years ago

Currently the slice API is sending the data for the range which has been requested. If we are in between two data points, the slice is empty. That's not right. Data exists but there are not represented.

Let's say there is t₀ < t₁(d) < t₂ < t₃ < t₄(d) < t₅

We request the range from=t₂&to=t₃, where there is no data point, it would probably be good to get the data from t₁(d) and t₄(d) and return that in the slice.

karlcow commented 5 years ago

This is a bit complex to implement to be effective, but we can probably do it.

karlcow commented 5 years ago

So I tried today to make it as simple as possible without too much recursion. I think we need to wait for the DB, that would be a lot more effective than trying to manage list slicing. :)