edgemesh / crux.run

The Chrome Real User Experience (CrUX) Database ... but faster
MIT License
7 stars 3 forks source link

Offset parameter? #11

Open samunderwood opened 4 years ago

samunderwood commented 4 years ago

One more question if that’s okay. Is it possible to add something to offset what month of data you want to pull?

For example, you can use months=2 to pull the past two months. But if I want to compare to 6 months ago I have to pull 6 months of data rather than just being able to specify I want 1 months worth of data from 6 months ago.

Maybe something like an ?offset=6 parameter or something would be handy?

Then I could do something like:

https://api.crux.run/v1/summary/overview/?domain=www.google.com&months=1

For last month and then:

https://api.crux.run/v1/summary/overview/?domain=www.google.com&months=1&offset=6

For 6 months ago.

jacobloveless commented 4 years ago

Hmmm….

one of the reasons why those queries are so quick is because it actually doesn't look at the month at all :)

It just uses the months input as an int to grab from the array (e.g. when you pass months = 6 internally we say "give me data from indices 0,1,2,3,4,5").

Is there an issue with pull multiple months and then trimming client side (other than the obvious waste of bandwidth :) )

So it's certainly not impossible but what's the use case that we can't satisfy today ? (also bulk pulling data is materially faster than polling … e.g. getting 6 months of data at once is ~ the same time as getting 1 month)

Sent via Superhuman ( https://sprh.mn/?vip=jacob.loveless@edgemesh.com )

On Thu, May 28, 2020 at 3:05 PM, samunderwood < notifications@github.com > wrote:

One more question if that’s okay. Is it possible to add something to offset what month of data you want to pull?

For example, you can use months=2 to pull the past two months. But if I want to compare to 6 months ago I have to pull 6 months of data rather than just being able to specify I want 1 months worth of data from 6 months ago.

Maybe something like an ?offset=6 parameter or something would be handy?

Then I could do something like:

https:/ / api. crux. run/ v1/ summary/ overview/ ?domain=www. google. com&months=1 ( https://api.crux.run/v1/summary/overview/?domain=www.google.com&months=1 )

For last month and then:

https:/ / api. crux. run/ v1/ summary/ overview/ ?domain=www. google. com&months=1&offset=6 ( https://api.crux.run/v1/summary/overview/?domain=www.google.com&months=1&offset=6 )

For 6 months ago.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub ( https://github.com/edgemesh/crux.run/issues/11 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AE6P44QZ65EPKD76OCDSDFDRT3NZFANCNFSM4NNPMDOA ).