-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit number of events in history #410
Limit number of events in history #410
Conversation
@@ -31,13 +31,13 @@ class EventController( | |||
) | |||
fun eventHistory( | |||
@PathVariable("name") name: ResourceName, | |||
@RequestParam("since", defaultValue = "1970-01-01T00:00:00Z") since: Instant | |||
@RequestParam("maxAge", defaultValue = "P3D") maxAge: Period, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to consider Pagination/InfiniteScrolling type approach here or not needed for the size of the data set ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to pile onto what Sairam said — ideally I expect the UI will want some kind of before
/ after
semantic to enable paging (as opposed to page 1/2/3 etc). I don't take issue with this maxAge
filter existing, provided it will peacefully coexist with the necessary filters for infinite scroll-y type paging later when needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we'll possibly want it eventually. In that case I think we'd add a page=whatever
param that would offset the results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should make sure it's token based, i.e. a ULID and order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would involve adding ULIDs to the events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(which I'm not against doing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe I should drop the max age and just have a default limit? Would be simple to add a "from ULID" to that in future. Currently I'm just trying to cut down on the volume of the responses. > 1MB of YAML is not a good thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I revised the PR to remove the maxAge
option and just have a limit
(defaulting to 10). We can easily enough add a ULID to each event and a before
parameter in a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @robfletcher!
You'll need to make the corresponding change here: https://github.com/spinnaker/gate/blob/de6efc207288e9008511b7042d50784f1c3f3af4/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/HistoryController.java#L37 |
1bdb206
to
54b1246
Compare
Defaults to 3 days, unlimited count.
54b1246
to
dcbd7b7
Compare
No description provided.