Uninett / Argus

Argus is an alert aggregator for monitoring systems
GNU General Public License v3.0
18 stars 13 forks source link

The incidents-endpoint needs pagination #132

Closed hmpf closed 4 years ago

hmpf commented 4 years ago

See #131 for filtering

hmpf commented 4 years ago

DRF comes with:

hmpf commented 4 years ago

See https://github.com/Uninett/Argus-frontend/issues/131 for frontend

hmpf commented 4 years ago

I think our best option is CursorPagination since we anticipate an abusrd amount of incidents. The questions then are:

  1. What should be the default page size in backend?
  2. A. Use the library that comes with drf, or B. write our own that uses headers?

Advantages of A: quick to do in the backend, we do not need to support it.

Disadvantages of A: json structure changes

Advantages of B: json structure does not change

Disadvantages of B: We need to support it, and some proxies fuck with headers

lunkwill42 commented 4 years ago

I really don't like limit/offset as arguments through the API. I like the page-number approach better, as it leaves the implementation details to the API. I find the cursor-based option intriguing, but I'll have to read up on it.

Also, pagination in the frontend gets tedious fast IMHO - what is our stance on the "infinite scrolling" paradigm? ;-)

hmpf commented 4 years ago

Gah, I actually copypasted wrong. I meant CursorPagination. I'll update the comment.

As for infinte scroll, personally I detest it, but this is not something made with me in mind ;) Whether it is doable for version 1 is another matter.

hmpf commented 4 years ago

(After a meeting we settled on: drf's own CursorPagination, default page size 100.)