refactor FilerRequest metrics (#3402)

* refactor FilerRequest metrics

* avoid double count proxy

* defer to
This commit is contained in:
Konstantin Lebedev
2022-08-04 13:44:54 +05:00
committed by GitHub
parent bd13a7968f
commit 22181dd018
8 changed files with 44 additions and 45 deletions

View File

@@ -16,7 +16,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/util"
)
@@ -34,12 +33,6 @@ func (fs *FilerServer) autoChunk(ctx context.Context, w http.ResponseWriter, r *
chunkSize := 1024 * 1024 * maxMB
stats.FilerRequestCounter.WithLabelValues("chunk").Inc()
start := time.Now()
defer func() {
stats.FilerRequestHistogram.WithLabelValues("chunk").Observe(time.Since(start).Seconds())
}()
var reply *FilerPostResult
var err error
var md5bytes []byte