mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
fix: TTFB prometheus metrics calculation (#11082)
until now metrics was reporting entire call duration instead of ttfb's this PR fixes it
This commit is contained in:
@@ -29,7 +29,6 @@ import (
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
xhttp "github.com/minio/minio/cmd/http"
|
||||
"github.com/minio/minio/cmd/logger"
|
||||
@@ -379,12 +378,7 @@ func collectAPIStats(api string, f http.HandlerFunc) http.HandlerFunc {
|
||||
|
||||
f.ServeHTTP(statsWriter, r)
|
||||
|
||||
// Time duration in secs since the call started.
|
||||
// We don't need to do nanosecond precision in this
|
||||
// simply for the fact that it is not human readable.
|
||||
durationSecs := time.Since(statsWriter.StartTime).Seconds()
|
||||
|
||||
globalHTTPStats.updateStats(api, r, statsWriter, durationSecs)
|
||||
globalHTTPStats.updateStats(api, r, statsWriter)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user