metrics: measure image transfers for image source operations#2271
Merged
tonistiigi merged 1 commit intodocker:masterfrom Mar 14, 2024
Merged
metrics: measure image transfers for image source operations#2271tonistiigi merged 1 commit intodocker:masterfrom
tonistiigi merged 1 commit intodocker:masterfrom
Conversation
This measures the transfer size and duration for image pulls along with the time spent extracting the image contents. Signed-off-by: Jonathan A. Sternberg <[email protected]>
3ff0623 to
9a71895
Compare
daghack
approved these changes
Mar 5, 2024
|
|
||
| var reImageSourceType = regexp.MustCompile(`^\[.*] FROM `) | ||
|
|
||
| func detectImageSourceType(vertexName string) bool { |
Contributor
There was a problem hiding this comment.
My only nitpick is that a used-once, one-line function seems a bit spaghetti!
Collaborator
Author
There was a problem hiding this comment.
I sometimes like to do this because it creates parity with another section of the code and it also abstracts an area that I consider to be non-essential to the original code. In the place where this is used, you can see it's just trying to detect if the line is an image source. This code implements the specific behavior. The original section of code doesn't need to know what the exact pattern is or the details but it just knows it's an image source.
tonistiigi
approved these changes
Mar 14, 2024
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.
This measures the transfer size and duration for image pulls along with the
time spent extracting the image contents.