mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
Admin Info: Modify Uptime to return seconds (#8635)
This commit is contained in:
parent
db3f41fcb4
commit
d266b3a066
@ -219,12 +219,12 @@ func (a adminAPIHandlers) ServiceActionHandler(w http.ResponseWriter, r *http.Re
|
||||
// ServerProperties holds some server information such as, version, region
|
||||
// uptime, etc..
|
||||
type ServerProperties struct {
|
||||
Uptime time.Duration `json:"uptime"`
|
||||
Version string `json:"version"`
|
||||
CommitID string `json:"commitID"`
|
||||
DeploymentID string `json:"deploymentID"`
|
||||
Region string `json:"region"`
|
||||
SQSARN []string `json:"sqsARN"`
|
||||
Uptime int64 `json:"uptime"`
|
||||
Version string `json:"version"`
|
||||
CommitID string `json:"commitID"`
|
||||
DeploymentID string `json:"deploymentID"`
|
||||
Region string `json:"region"`
|
||||
SQSARN []string `json:"sqsARN"`
|
||||
}
|
||||
|
||||
// ServerConnStats holds transferred bytes from/to the server
|
||||
|
@ -242,7 +242,7 @@ func getLocalServerProperty(endpointZones EndpointZones, r *http.Request) madmin
|
||||
return madmin.ServerProperties{
|
||||
State: "ok",
|
||||
Endpoint: addr,
|
||||
Uptime: UTCNow().Sub(globalBootTime),
|
||||
Uptime: UTCNow().Unix() - globalBootTime.Unix(),
|
||||
Version: Version,
|
||||
CommitID: CommitID,
|
||||
Network: network,
|
||||
|
@ -52,7 +52,7 @@ func getServerInfo() (*ServerInfoData, error) {
|
||||
ConnStats: globalConnStats.toServerConnStats(),
|
||||
HTTPStats: globalHTTPStats.toServerHTTPStats(),
|
||||
Properties: ServerProperties{
|
||||
Uptime: UTCNow().Sub(globalBootTime),
|
||||
Uptime: UTCNow().Unix() - globalBootTime.Unix(),
|
||||
Version: Version,
|
||||
CommitID: CommitID,
|
||||
DeploymentID: globalDeploymentID,
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
humanize "github.com/dustin/go-humanize"
|
||||
"github.com/minio/minio/pkg/cpu"
|
||||
@ -425,7 +424,7 @@ type XlBackend struct {
|
||||
type ServerProperties struct {
|
||||
State string `json:"state"`
|
||||
Endpoint string `json:"endpoint"`
|
||||
Uptime time.Duration `json:"uptime"`
|
||||
Uptime int64 `json:"uptime"`
|
||||
Version string `json:"version"`
|
||||
CommitID string `json:"commitID"`
|
||||
Network map[string]string `json:"network"`
|
||||
|
Loading…
Reference in New Issue
Block a user