Change blob latency metrics to ms (#13481)

This commit is contained in:
terence 2024-01-17 15:28:42 -08:00 committed by GitHub
parent 93aba997f4
commit c3dbfa66d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -156,7 +156,7 @@ func (bs *BlobStorage) Save(sidecar blocks.VerifiedROBlob) error {
} }
partialMoved = true partialMoved = true
blobsWrittenCounter.Inc() blobsWrittenCounter.Inc()
blobSaveLatency.Observe(time.Since(startTime).Seconds()) blobSaveLatency.Observe(float64(time.Since(startTime).Milliseconds()))
return nil return nil
} }
@ -180,7 +180,7 @@ func (bs *BlobStorage) Get(root [32]byte, idx uint64) (blocks.VerifiedROBlob, er
return blocks.VerifiedROBlob{}, err return blocks.VerifiedROBlob{}, err
} }
defer func() { defer func() {
blobFetchLatency.Observe(time.Since(startTime).Seconds()) blobFetchLatency.Observe(float64(time.Since(startTime).Milliseconds()))
}() }()
return verification.BlobSidecarNoop(ro) return verification.BlobSidecarNoop(ro)
} }

View File

@ -6,15 +6,15 @@ import (
) )
var ( var (
blobBuckets = []float64{0.00003, 0.00005, 0.00007, 0.00009, 0.00011, 0.00013, 0.00015} blobBuckets = []float64{3, 5, 7, 9, 11, 13}
blobSaveLatency = promauto.NewHistogram(prometheus.HistogramOpts{ blobSaveLatency = promauto.NewHistogram(prometheus.HistogramOpts{
Name: "blob_storage_save_latency", Name: "blob_storage_save_latency",
Help: "Latency of BlobSidecar storage save operations in seconds", Help: "Latency of BlobSidecar storage save operations in milliseconds",
Buckets: blobBuckets, Buckets: blobBuckets,
}) })
blobFetchLatency = promauto.NewHistogram(prometheus.HistogramOpts{ blobFetchLatency = promauto.NewHistogram(prometheus.HistogramOpts{
Name: "blob_storage_get_latency", Name: "blob_storage_get_latency",
Help: "Latency of BlobSidecar storage get operations in seconds", Help: "Latency of BlobSidecar storage get operations in milliseconds",
Buckets: blobBuckets, Buckets: blobBuckets,
}) })
blobsPrunedCounter = promauto.NewCounter(prometheus.CounterOpts{ blobsPrunedCounter = promauto.NewCounter(prometheus.CounterOpts{