Register imagePullThroughput and count with MiB
Signed-off-by: Shukui Yang <yangshukui@bytedance.com>
This commit is contained in:
@@ -209,8 +209,9 @@ func (c *criService) PullImage(ctx context.Context, r *runtime.PullImageRequest)
|
||||
}
|
||||
}
|
||||
|
||||
const mbToByte = 1024 * 1024
|
||||
size, _ := image.Size(ctx)
|
||||
imagePullingSpeed := float64(size) / time.Since(startTime).Seconds()
|
||||
imagePullingSpeed := float64(size) / mbToByte / time.Since(startTime).Seconds()
|
||||
imagePullThroughput.Observe(imagePullingSpeed)
|
||||
|
||||
log.G(ctx).Infof("Pulled image %q with image id %q, repo tag %q, repo digest %q, size %q in %s", imageRef, imageID,
|
||||
|
||||
Reference in New Issue
Block a user