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

fix(metrics): correct image pull throughput calculation #10259

Closed
wants to merge 1 commit into from

Conversation

azr
Copy link
Contributor

@azr azr commented May 24, 2024

Hello there,

If I'm correct, image.Size() returns an addition of blob sizes that are already in bytes, so the division is not needed here.

containerd/client/image.go

Lines 176 to 178 in 504bd15

func (i *image) Size(ctx context.Context) (int64, error) {
return usage.CalculateImageUsage(ctx, i.i, i.client.ContentStore(), usage.WithManifestLimit(i.platform, 1), usage.WithManifestUsage())
}

Size int64 // provides usage, in bytes, of snapshot

@k8s-ci-robot
Copy link

Hi @azr. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Signed-off-by: Adrien Delorme <azr@users.noreply.github.com>
Comment on lines +239 to 240
imagePullingSpeed := float64(sizeByte) / time.Since(startTime).Seconds()
imagePullThroughput.Observe(imagePullingSpeed)
Copy link
Member

Choose a reason for hiding this comment

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

Assumed to be MB

// image size in MB / image pull duration in seconds
imagePullThroughput prom.Histogram

// image size in MB / image pull duration in seconds

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, good catch, closing !

@azr azr closed this May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants