change ReadPerf into ReadThroughput in NetPerfInfo. (#8316)

Previously `ReadPerf` was in time.Duration is changed to `ReadThroughput` in uint64.
This commit is contained in:
Bala FA
2019-09-26 18:31:18 +00:00
committed by kannappanr
parent fd53057654
commit 2a2ff96ee1
4 changed files with 14 additions and 13 deletions
+3 -3
View File
@@ -334,9 +334,9 @@ type ServerMemUsageInfo struct {
// ServerNetReadPerfInfo network read performance information.
type ServerNetReadPerfInfo struct {
Addr string `json:"addr"`
ReadPerf time.Duration `json:"readPerf"`
Error string `json:"error,omitempty"`
Addr string `json:"addr"`
ReadThroughput uint64 `json:"readThroughput"`
Error string `json:"error,omitempty"`
}
// PerfInfoHandler - GET /minio/admin/v1/performance?perfType={perfType}
+3 -2
View File
@@ -106,9 +106,10 @@ func (s *peerRESTServer) NetReadPerfInfoHandler(w http.ResponseWriter, r *http.R
addr = GetLocalPeer(globalEndpoints)
}
d := end.Sub(start)
info := ServerNetReadPerfInfo{
Addr: addr,
ReadPerf: end.Sub(start),
Addr: addr,
ReadThroughput: uint64(int64(time.Second) * size / int64(d)),
}
ctx := newContext(r, w, "NetReadPerfInfo")