Added storage latency histogram metric

Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
Alexei Dodon
2021-12-21 15:19:40 +02:00
committed by Ramkumar Chinchani
parent 4f825a5e2f
commit c4d34b7269
11 changed files with 251 additions and 80 deletions
+7 -4
View File
@@ -12,6 +12,7 @@ import (
"strings"
"sync"
"testing"
"time"
// Add s3 support.
"github.com/docker/distribution/registry/storage/driver"
@@ -599,16 +600,18 @@ func TestStorageAPIs(t *testing.T) {
for i := 0; i < 1000; i++ {
wg.Add(2)
go func() {
var lockLatency time.Time
defer wg.Done()
imgStore.Lock()
imgStore.Lock(&lockLatency)
func() {}()
imgStore.Unlock()
imgStore.Unlock(&lockLatency)
}()
go func() {
var lockLatency time.Time
defer wg.Done()
imgStore.RLock()
imgStore.RLock(&lockLatency)
func() {}()
imgStore.RUnlock()
imgStore.RUnlock(&lockLatency)
}()
}
wg.Wait()