-
Notifications
You must be signed in to change notification settings - Fork 0
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
[stateunstable] Add metric-usages-by-metric-name and metric-usages-by-label-name list cmds #35
[stateunstable] Add metric-usages-by-metric-name and metric-usages-by-label-name list cmds #35
Conversation
…eunstable-metric-usages-by-name-and-label
…eunstable-metric-usages-by-name-and-label
…ic-usages-by-name-and-label
|
||
// loop until we've fetched enough results | ||
for { | ||
current, token, err := listFn(Page{Size: pageSize, Token: nextToken}) |
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.
based on what im reading, if i try to send in pageSize == 1 million it will attempt to get 1 million records in a go. does this fail or default to the max allowed in API?
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.
It will not fail in the API. The max amount of results we see in practice is <20k in most tenants. This API returns about 100k max results for our largest tenant.
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 the BE should be enforcing some max so if PageSize is > that max, or if PageSize == 0, that max is what is used.
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func mockListFn(p Page) ([]string, string, error) { |
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.
can you add a test that doesn't set Page.Size
? let it default to zero.
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.
Done
Adds chronoctl support for the new unstable state metric usages APIs