Skip to content

Commit e6bc4aa

Browse files
committed
backends/s3: fix list metric
1 parent 3643db9 commit e6bc4aa

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

backends/s3/s3.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ func recordMinioDurationMetric(method string, start time.Time) {
247247
}
248248

249249
func (b *Backend) doList(ctx context.Context, prefix string) (blobs simpleblob.BlobList, err error) {
250+
metricCalls.WithLabelValues("list").Inc()
251+
metricLastCallTimestamp.WithLabelValues("list").SetToCurrentTime()
250252
ctx, cancel := b.clientTimeoutContext(ctx)
251253
defer cancel()
252254
defer recordMinioDurationMetric("list", time.Now())
@@ -266,8 +268,6 @@ func (b *Backend) doList(ctx context.Context, prefix string) (blobs simpleblob.B
266268
return nil, err
267269
}
268270

269-
metricCalls.WithLabelValues("list").Inc()
270-
metricLastCallTimestamp.WithLabelValues("list").SetToCurrentTime()
271271
if obj.Key == b.markerName {
272272
continue
273273
}
@@ -315,7 +315,6 @@ func (b *Backend) Load(ctx context.Context, name string) ([]byte, error) {
315315
func (b *Backend) doLoadReader(ctx context.Context, name string) (*minio.Object, error) {
316316
metricCalls.WithLabelValues("load").Inc()
317317
metricLastCallTimestamp.WithLabelValues("load").SetToCurrentTime()
318-
319318
defer recordMinioDurationMetric("load", time.Now())
320319

321320
obj, err := b.client.GetObject(ctx, b.opt.Bucket, name, minio.GetObjectOptions{})

0 commit comments

Comments
 (0)