Skip to content
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

Record the number of bytes read from storage in a metric #1206

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mjh1
Copy link
Contributor

@mjh1 mjh1 commented Apr 2, 2024

Since it is hard to get access logging from storage providers this will give us an idea of where the egress usage is coming from, making it easier to optimise.

Tested on staging:
Screenshot 2024-04-02 at 18 40 57

Since it is hard to get access logging from storage providers this will give us an idea of where the egress usage is coming from, making it easier to optimise.
@mjh1 mjh1 requested review from thomshutt and leszko April 2, 2024 17:49
Copy link
Contributor

@leszko leszko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Added one comment. Other than that, I think we could keep an eye on the performance if it was not declined, because of this TeeReadCloser.

@@ -26,6 +26,51 @@ func DownloadOSURL(osURL string) (io.ReadCloser, error) {
return fileInfoReader.Body, nil
}

func NewTeeReadCloser(readCloser io.ReadCloser, writer io.Writer) io.ReadCloser {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a unit test for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants