add HTTPStats to madmin (#5299)

This commit is contained in:
Matthieu Paret 2017-12-23 02:47:30 +01:00 committed by kannappanr
parent 6ef0161835
commit 374feda237

View File

@ -74,11 +74,34 @@ type ServerConnStats struct {
TotalOutputBytes uint64 `json:"received"` TotalOutputBytes uint64 `json:"received"`
} }
// ServerHTTPMethodStats holds total number of HTTP operations from/to the server,
// including the average duration the call was spent.
type ServerHTTPMethodStats struct {
Count uint64 `json:"count"`
AvgDuration string `json:"avgDuration"`
}
// ServerHTTPStats holds all type of http operations performed to/from the server
// including their average execution time.
type ServerHTTPStats struct {
TotalHEADStats ServerHTTPMethodStats `json:"totalHEADs"`
SuccessHEADStats ServerHTTPMethodStats `json:"successHEADs"`
TotalGETStats ServerHTTPMethodStats `json:"totalGETs"`
SuccessGETStats ServerHTTPMethodStats `json:"successGETs"`
TotalPUTStats ServerHTTPMethodStats `json:"totalPUTs"`
SuccessPUTStats ServerHTTPMethodStats `json:"successPUTs"`
TotalPOSTStats ServerHTTPMethodStats `json:"totalPOSTs"`
SuccessPOSTStats ServerHTTPMethodStats `json:"successPOSTs"`
TotalDELETEStats ServerHTTPMethodStats `json:"totalDELETEs"`
SuccessDELETEStats ServerHTTPMethodStats `json:"successDELETEs"`
}
// ServerInfoData holds storage, connections and other // ServerInfoData holds storage, connections and other
// information of a given server // information of a given server
type ServerInfoData struct { type ServerInfoData struct {
StorageInfo StorageInfo `json:"storage"` StorageInfo StorageInfo `json:"storage"`
ConnStats ServerConnStats `json:"network"` ConnStats ServerConnStats `json:"network"`
HTTPStats ServerHTTPStats `json:"http"`
Properties ServerProperties `json:"server"` Properties ServerProperties `json:"server"`
} }