From e21c472dc78f5f4470c497207a46623f4840631b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 29 Nov 2022 14:47:00 +0300 Subject: [PATCH] [#1984] services/object: Increase put_req_count after the request is processed As it is specified in metrics description. Signed-off-by: Evgenii Stratonikov --- pkg/services/object/metrics.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/services/object/metrics.go b/pkg/services/object/metrics.go index a8f5c274..effa024d 100644 --- a/pkg/services/object/metrics.go +++ b/pkg/services/object/metrics.go @@ -71,9 +71,6 @@ func (m MetricCollector) Get(req *object.GetRequest, stream GetObjectStream) err func (m MetricCollector) Put(ctx context.Context) (PutObjectStream, error) { t := time.Now() - defer func() { - m.metrics.IncPutReqCounter() - }() stream, err := m.next.Put(ctx) if err != nil { @@ -157,6 +154,7 @@ func (s putStreamMetric) Send(req *object.PutRequest) error { func (s putStreamMetric) CloseAndRecv() (*object.PutResponse, error) { defer func() { + s.metrics.IncPutReqCounter() s.metrics.AddPutReqDuration(time.Since(s.start)) }()