fix: gateway_s3_bytes_sent metric for all API methods (#9242)

Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
poornas
2020-04-01 12:52:31 -07:00
committed by GitHub
parent 95e89f1712
commit 336460f67e
4 changed files with 29 additions and 4 deletions

View File

@@ -26,6 +26,8 @@ import (
type RequestStats struct {
Get atomic.Uint64 `json:"Get"`
Head atomic.Uint64 `json:"Head"`
Put atomic.Uint64 `json:"Put"`
Post atomic.Uint64 `json:"Post"`
}
// Metrics - represents bytes served from backend
@@ -63,6 +65,10 @@ func (s *Metrics) IncRequests(method string) {
s.requestStats.Get.Add(1)
} else if method == http.MethodHead {
s.requestStats.Head.Add(1)
} else if method == http.MethodPut {
s.requestStats.Put.Add(1)
} else if method == http.MethodPost {
s.requestStats.Post.Add(1)
}
}