Skip to content

Commit 17ab5dd

Browse files
authored
Merge pull request #5114 from alakesh/print-unpack-time
Print elapsed time for image unpack
2 parents ddf6594 + 9f5244f commit 17ab5dd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cmd/ctr/commands/images/pull.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package images
1919
import (
2020
"fmt"
2121
"net/http/httptrace"
22+
"time"
2223

2324
"github.com/containerd/containerd"
2425
"github.com/containerd/containerd/cmd/ctr/commands"
@@ -124,6 +125,7 @@ command. As part of this process, we do the following:
124125
p = append(p, platforms.DefaultSpec())
125126
}
126127

128+
start := time.Now()
127129
for _, platform := range p {
128130
fmt.Printf("unpacking %s %s...\n", platforms.Format(platform), img.Target.Digest)
129131
i := containerd.NewImageWithPlatform(client, img, platforms.Only(platform))
@@ -140,8 +142,7 @@ command. As part of this process, we do the following:
140142
fmt.Printf("image chain ID: %s\n", chainID)
141143
}
142144
}
143-
144-
fmt.Println("done")
145+
fmt.Printf("done: %s\t\n", time.Since(start))
145146
return nil
146147
},
147148
}

0 commit comments

Comments
 (0)