Skip to content

Commit

Permalink
refactor: print execution time
Browse files Browse the repository at this point in the history
Signed-off-by: KevFan <chfan@redhat.com>
  • Loading branch information
KevFan committed Sep 11, 2024
1 parent e32e453 commit d378a59
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions quay/quay_overflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"os"
"regexp"
"time"

"golang.org/x/exp/maps"
"oras.land/oras-go/pkg/registry/remote"
Expand Down Expand Up @@ -56,6 +57,8 @@ func main() {
logger.Fatalln("no access token provided")
}

beginningTime := time.Now()

// Fetch tags from the API
tags, err := fetchTags(client, baseURL, repo)
if err != nil {
Expand Down Expand Up @@ -89,6 +92,7 @@ func main() {
// Print remaining tags
logger.Println("Preserved tags:", maps.Keys(preservedTags), "num", len(preservedTags))
logger.Println("Tags not deleted successfully:", maps.Keys(tagsToDelete), len(tagsToDelete))
logger.Println("Execution time:", time.Since(beginningTime).String())
}

// fetchTags retrieves the tags from the repository using the Quay.io API.
Expand Down

0 comments on commit d378a59

Please sign in to comment.