chore(benchmarking): Putting temp files in try with resource for cleanup#2208
Merged
sydney-munro merged 2 commits intomainfrom Sep 15, 2023
Merged
chore(benchmarking): Putting temp files in try with resource for cleanup#2208sydney-munro merged 2 commits intomainfrom
sydney-munro merged 2 commits intomainfrom
Conversation
sydney-munro
commented
Sep 14, 2023
| // Create the file to be uploaded and fill it with data | ||
| TmpFile file = DataGenerator.base64Characters().tempFile(tempDirectory, objectSize); | ||
| BlobInfo blob = BlobInfo.newBuilder(bucketName, file.toString()).build(); | ||
| try(TmpFile file = DataGenerator.base64Characters().tempFile(tempDirectory, objectSize)) { |
Contributor
Author
There was a problem hiding this comment.
The only actual changes here are the additions of the try here
sydney-munro
commented
Sep 14, 2023
| created) | ||
| .formatAsCustomMetric()); | ||
| for (int i = 0; i <= StorageSharedBenchmarkingUtils.DEFAULT_NUMBER_OF_READS; i++) { | ||
| try (TmpFile dest = TmpFile.of(tempDirectory, "prefix", "bin")) { |
Contributor
Author
There was a problem hiding this comment.
and here, the rest is formatting.
BenWhitehead
approved these changes
Sep 15, 2023
Collaborator
BenWhitehead
left a comment
There was a problem hiding this comment.
Primary change looks okay, but there is a follow up for the data generation that will need to be addressed.
| // Create the file to be uploaded and fill it with data | ||
| TmpFile file = DataGenerator.base64Characters().tempFile(tempDirectory, objectSize); | ||
| BlobInfo blob = BlobInfo.newBuilder(bucketName, file.toString()).build(); | ||
| try (TmpFile file = DataGenerator.base64Characters().tempFile(tempDirectory, objectSize)) { |
Collaborator
There was a problem hiding this comment.
you don't want to use the base64 character set here for generate. It creates highly compressible and dedupeable data which Gcs sometimes will optimize for leading to skewed data.
You can either use the existing rand or port the devUrandom implementation from the existing benchmarks into this repos version.
it's fine to do this in a follow up pr.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.