Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Gauges queries #8563
Gauges queries #8563
Changes from 3 commits
80c8ab3
e165a04
3b7495c
c250a32
240dff4
b8f3f8b
3737f0e
9ae40ee
3b0553e
6ea52f4
54a8ade
b17e8d5
ad3ec0f
1fe715f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 this change right now? It seems like we're not calling this anymore
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 we not filter than paginate? I'm curious if we paginate then filter inside, we wouldn't be getting correct pagination (e.g user wants 100 results, we do a filter inside and only returns 30 results). I might be wrong on this
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.
Huum the way I understand how FilteredPaginate works it will continue to iterate until it reaches the 100 results.
I just missed one important point: to return true at the end of the closure when new element is added to the result.
When the closure returns
true
the FilteredPaginate function increments the numbered of hit elements and verifies thatnum_hit < request.Limit
before continuing to iterate.I will make the update.
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.
This function looks not correct if I am right about the way FilteredPaginate works. What do you think @mattverse
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 part are you sus about?
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.
Iterating over newGauges the closure returns false if the denom is not the expected one.
In some situations we can miss a gauge
If len(newGauges) == 2
Index 0 : denom is not expecting one
Index 1 : denom is the expecting one
we are going to exit at first iteration without adding the second gauge in the response.
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, this is an edge case as mentioned in the comment that we need to fix :(