mirror of
https://github.com/project-zot/zot.git
synced 2026-06-15 20:07:55 +08:00
Added storage latency histogram metric
Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
4f825a5e2f
commit
c4d34b7269
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user