From 374feda2374600e636ad98daa9120e4903ccc539 Mon Sep 17 00:00:00 2001 From: Matthieu Paret Date: Sat, 23 Dec 2017 02:47:30 +0100 Subject: [PATCH] add HTTPStats to madmin (#5299) --- pkg/madmin/info-commands.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pkg/madmin/info-commands.go b/pkg/madmin/info-commands.go index f6f93265e..db9ffe5d0 100644 --- a/pkg/madmin/info-commands.go +++ b/pkg/madmin/info-commands.go @@ -74,11 +74,34 @@ type ServerConnStats struct { 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 // information of a given server type ServerInfoData struct { StorageInfo StorageInfo `json:"storage"` ConnStats ServerConnStats `json:"network"` + HTTPStats ServerHTTPStats `json:"http"` Properties ServerProperties `json:"server"` }