fix: optimize DiskInfo() call avoid metrics when not needed (#17763)

This commit is contained in:
Harshavardhana
2023-07-31 15:20:48 -07:00
committed by GitHub
parent 8162fd1e20
commit 81be718674
27 changed files with 92 additions and 63 deletions

View File

@@ -173,7 +173,7 @@ func (s *storageRESTServer) DiskInfoHandler(w http.ResponseWriter, r *http.Reque
if !s.IsAuthValid(w, r) {
return
}
info, err := s.storage.DiskInfo(r.Context())
info, err := s.storage.DiskInfo(r.Context(), r.Form.Get(storageRESTMetrics) == "true")
if err != nil {
info.Error = err.Error()
}