This repository was archived by the owner on Aug 19, 2019. It is now read-only.
Split the metadata API request when it hits a limit by count or byte size#129
Merged
supriyagarg merged 3 commits intoStackdriver:masterfrom Apr 4, 2018
Merged
Conversation
2eb3b98 to
c54b554
Compare
c54b554 to
4f83350
Compare
ACEmilG
suggested changes
Apr 4, 2018
Contributor
ACEmilG
left a comment
There was a problem hiding this comment.
Looks mostly good, however I do wonder about making this configurable above 1k. Given that there is a limit on the server-side, should we enforce this limit on the client? ie the limit is min(1k, configuration)
| "v1beta2/projects/{{project_id}}/resourceMetadata:batchUpdate", | ||
| config.MetadataIngestionEndpointFormat()); | ||
| EXPECT_EQ(8*1024*1024, config.MetadataIngestionRequestSizeLimitBytes()); | ||
| EXPECT_EQ(1000, config.MetadataIngestionRequestSizeLimitCount()); |
Contributor
There was a problem hiding this comment.
Please also add a check in the PopulatedConfig test for the non-default case.
dhrupadb
reviewed
Apr 4, 2018
src/reporter.cc
Outdated
| continue; | ||
| } | ||
| if (total_size + size > limit_bytes) { | ||
| if (entries.size() > limit_count || total_size + size > limit_bytes) { |
Contributor
There was a problem hiding this comment.
I'm confused by this line. Seems like we're already violating these bounds no? Unless SendMetadataEntry does some special batching.
Contributor
Author
There was a problem hiding this comment.
you are right, there should be an equality here since the count does not include the latest entry. Updated.
7012443 to
8d66b62
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.