mirror of
https://github.com/minio/minio.git
synced 2025-01-12 07:23:23 -05:00
Add runtime mem stats to server info (#11995)
Adds information about runtime+gc memory use.
This commit is contained in:
parent
d267d152ba
commit
48c5e7e5b6
@ -271,21 +271,6 @@ type ServerHTTPStats struct {
|
|||||||
TotalS3RejectedInvalid uint64 `json:"totalS3RejectedInvalid"`
|
TotalS3RejectedInvalid uint64 `json:"totalS3RejectedInvalid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServerInfoData holds storage, connections and other
|
|
||||||
// information of a given server.
|
|
||||||
type ServerInfoData struct {
|
|
||||||
ConnStats ServerConnStats `json:"network"`
|
|
||||||
HTTPStats ServerHTTPStats `json:"http"`
|
|
||||||
Properties ServerProperties `json:"server"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// ServerInfo holds server information result of one node
|
|
||||||
type ServerInfo struct {
|
|
||||||
Error string `json:"error"`
|
|
||||||
Addr string `json:"addr"`
|
|
||||||
Data *ServerInfoData `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// StorageInfoHandler - GET /minio/admin/v3/storageinfo
|
// StorageInfoHandler - GET /minio/admin/v3/storageinfo
|
||||||
// ----------
|
// ----------
|
||||||
// Get server information
|
// Get server information
|
||||||
|
@ -19,6 +19,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/minio/minio/cmd/logger"
|
"github.com/minio/minio/cmd/logger"
|
||||||
@ -67,6 +68,7 @@ func getLocalServerProperty(endpointServerPools EndpointServerPools, r *http.Req
|
|||||||
CommitID: CommitID,
|
CommitID: CommitID,
|
||||||
Network: network,
|
Network: network,
|
||||||
}
|
}
|
||||||
|
runtime.ReadMemStats(&props.MemStats)
|
||||||
|
|
||||||
objLayer := newObjectLayerFn()
|
objLayer := newObjectLayerFn()
|
||||||
if objLayer != nil && !globalIsGateway {
|
if objLayer != nil && !globalIsGateway {
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -316,6 +317,7 @@ type ServerProperties struct {
|
|||||||
Network map[string]string `json:"network,omitempty"`
|
Network map[string]string `json:"network,omitempty"`
|
||||||
Disks []Disk `json:"drives,omitempty"`
|
Disks []Disk `json:"drives,omitempty"`
|
||||||
PoolNumber int `json:"poolNumber,omitempty"`
|
PoolNumber int `json:"poolNumber,omitempty"`
|
||||||
|
MemStats runtime.MemStats `json:"mem_stats"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DiskMetrics has the information about XL Storage APIs
|
// DiskMetrics has the information about XL Storage APIs
|
||||||
|
Loading…
Reference in New Issue
Block a user