feat(metrics): add scheduler related metrics (#2076)

Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
Alexei Dodon
2023-12-05 00:13:50 +02:00
committed by GitHub
parent 8bac653dd2
commit 2e733b3f4f
21 changed files with 566 additions and 69 deletions
+10
View File
@@ -5,6 +5,7 @@ package sync
import (
"context"
"fmt"
"github.com/containers/common/pkg/retry"
"github.com/containers/image/v5/types"
@@ -137,3 +138,12 @@ func newSyncRepoTask(repo string, service Service) *syncRepoTask {
func (srt *syncRepoTask) DoWork(ctx context.Context) error {
return srt.service.SyncRepo(ctx, srt.repo)
}
func (srt *syncRepoTask) String() string {
return fmt.Sprintf("{Name: \"%s\", repo: \"%s\"}",
srt.Name(), srt.repo)
}
func (srt *syncRepoTask) Name() string {
return "SyncTask"
}