change `ReadPerf` into `ReadThroughput` in NetPerfInfo. (#8316)

Previously `ReadPerf` was in time.Duration is changed to `ReadThroughput` in uint64.
master
Bala FA 5 years ago committed by kannappanr
parent fd53057654
commit 2a2ff96ee1
  1. 6
      cmd/admin-handlers.go
  2. 5
      cmd/peer-rest-server.go
  3. 10
      pkg/madmin/README.md
  4. 6
      pkg/madmin/info-commands.go

@ -334,9 +334,9 @@ type ServerMemUsageInfo struct {
// ServerNetReadPerfInfo network read performance information. // ServerNetReadPerfInfo network read performance information.
type ServerNetReadPerfInfo struct { type ServerNetReadPerfInfo struct {
Addr string `json:"addr"` Addr string `json:"addr"`
ReadPerf time.Duration `json:"readPerf"` ReadThroughput uint64 `json:"readThroughput"`
Error string `json:"error,omitempty"` Error string `json:"error,omitempty"`
} }
// PerfInfoHandler - GET /minio/admin/v1/performance?perfType={perfType} // PerfInfoHandler - GET /minio/admin/v1/performance?perfType={perfType}

@ -106,9 +106,10 @@ func (s *peerRESTServer) NetReadPerfInfoHandler(w http.ResponseWriter, r *http.R
addr = GetLocalPeer(globalEndpoints) addr = GetLocalPeer(globalEndpoints)
} }
d := end.Sub(start)
info := ServerNetReadPerfInfo{ info := ServerNetReadPerfInfo{
Addr: addr, Addr: addr,
ReadPerf: end.Sub(start), ReadThroughput: uint64(int64(time.Second) * size / int64(d)),
} }
ctx := newContext(r, w, "NetReadPerfInfo") ctx := newContext(r, w, "NetReadPerfInfo")

@ -280,11 +280,11 @@ Fetches Mem utilization for all cluster nodes.
Fetches network performance of all cluster nodes using given sized payload. Returned value is a map containing each node indexed list of performance of other nodes. Fetches network performance of all cluster nodes using given sized payload. Returned value is a map containing each node indexed list of performance of other nodes.
| Param | Type | Description | | Param | Type | Description |
|------------|------------------|--------------------------------------------------------------------| |------------------|-----------|--------------------------------------------------------------------|
| `Addr` | _string_ | Address of the server the following information is retrieved from. | | `Addr` | _string_ | Address of the server the following information is retrieved from. |
| `Error` | _string_ | Errors (if any) encountered while reaching this node | | `Error` | _string_ | Errors (if any) encountered while reaching this node |
| `ReadPerf` | _time.Duration_ | Network read performance of the server | | `ReadThroughput` | _uint64_ | Network read throughput of the server in bytes per second |
## 5. Heal operations ## 5. Heal operations

@ -305,9 +305,9 @@ func (adm *AdminClient) ServerMemUsageInfo() ([]ServerMemUsageInfo, error) {
// NetPerfInfo network performance information. // NetPerfInfo network performance information.
type NetPerfInfo struct { type NetPerfInfo struct {
Addr string `json:"addr"` Addr string `json:"addr"`
ReadPerf time.Duration `json:"readPerf"` ReadThroughput uint64 `json:"readThroughput"`
Error string `json:"error,omitempty"` Error string `json:"error,omitempty"`
} }
// NetPerfInfo - Returns network performance information of all cluster nodes. // NetPerfInfo - Returns network performance information of all cluster nodes.

Loading…
Cancel
Save