fix: more accurate storage metrics after zot restart (#1972)

Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
Alexei Dodon
2023-11-01 18:09:21 +02:00
committed by GitHub
parent 3e6053e1db
commit a79d79a03a
10 changed files with 195 additions and 20 deletions
+7
View File
@@ -55,6 +55,7 @@ type MockedImageStore struct {
GetAllBlobsFn func(repo string) ([]string, error)
CleanupRepoFn func(repo string, blobs []godigest.Digest, removeRepo bool) (int, error)
PutIndexContentFn func(repo string, index ispec.Index) error
PopulateStorageMetricsFn func(interval time.Duration, sch *scheduler.Scheduler)
}
func (is MockedImageStore) Lock(t *time.Time) {
@@ -405,3 +406,9 @@ func (is MockedImageStore) PutIndexContent(repo string, index ispec.Index) error
return nil
}
func (is MockedImageStore) PopulateStorageMetrics(interval time.Duration, sch *scheduler.Scheduler) {
if is.PopulateStorageMetricsFn != nil {
is.PopulateStorageMetricsFn(interval, sch)
}
}