Admin Info: Modify Uptime to return seconds (#8635)

master
kannappanr 5 years ago committed by GitHub
parent db3f41fcb4
commit d266b3a066
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/admin-handlers.go
  2. 2
      cmd/admin-server-info.go
  3. 2
      cmd/peer-rest-server.go
  4. 3
      pkg/madmin/info-commands.go

@ -219,7 +219,7 @@ func (a adminAPIHandlers) ServiceActionHandler(w http.ResponseWriter, r *http.Re
// ServerProperties holds some server information such as, version, region // ServerProperties holds some server information such as, version, region
// uptime, etc.. // uptime, etc..
type ServerProperties struct { type ServerProperties struct {
Uptime time.Duration `json:"uptime"` Uptime int64 `json:"uptime"`
Version string `json:"version"` Version string `json:"version"`
CommitID string `json:"commitID"` CommitID string `json:"commitID"`
DeploymentID string `json:"deploymentID"` DeploymentID string `json:"deploymentID"`

@ -242,7 +242,7 @@ func getLocalServerProperty(endpointZones EndpointZones, r *http.Request) madmin
return madmin.ServerProperties{ return madmin.ServerProperties{
State: "ok", State: "ok",
Endpoint: addr, Endpoint: addr,
Uptime: UTCNow().Sub(globalBootTime), Uptime: UTCNow().Unix() - globalBootTime.Unix(),
Version: Version, Version: Version,
CommitID: CommitID, CommitID: CommitID,
Network: network, Network: network,

@ -52,7 +52,7 @@ func getServerInfo() (*ServerInfoData, error) {
ConnStats: globalConnStats.toServerConnStats(), ConnStats: globalConnStats.toServerConnStats(),
HTTPStats: globalHTTPStats.toServerHTTPStats(), HTTPStats: globalHTTPStats.toServerHTTPStats(),
Properties: ServerProperties{ Properties: ServerProperties{
Uptime: UTCNow().Sub(globalBootTime), Uptime: UTCNow().Unix() - globalBootTime.Unix(),
Version: Version, Version: Version,
CommitID: CommitID, CommitID: CommitID,
DeploymentID: globalDeploymentID, DeploymentID: globalDeploymentID,

@ -24,7 +24,6 @@ import (
"net/http" "net/http"
"net/url" "net/url"
"strconv" "strconv"
"time"
humanize "github.com/dustin/go-humanize" humanize "github.com/dustin/go-humanize"
"github.com/minio/minio/pkg/cpu" "github.com/minio/minio/pkg/cpu"
@ -425,7 +424,7 @@ type XlBackend struct {
type ServerProperties struct { type ServerProperties struct {
State string `json:"state"` State string `json:"state"`
Endpoint string `json:"endpoint"` Endpoint string `json:"endpoint"`
Uptime time.Duration `json:"uptime"` Uptime int64 `json:"uptime"`
Version string `json:"version"` Version string `json:"version"`
CommitID string `json:"commitID"` CommitID string `json:"commitID"`
Network map[string]string `json:"network"` Network map[string]string `json:"network"`

Loading…
Cancel
Save