Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

hide millseconds in up time (#7553)

Trim217c7b673fc148
diff --git a/weed/server/master_server_handlers_ui.go b/weed/server/master_server_handlers_ui.go
index 65195ee1e1..157376f5bf 100644
--- a/weed/server/master_server_handlers_ui.go
+++ b/weed/server/master_server_handlers_ui.go
@@ -1,10 +1,11 @@
package weed_server
import (
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"net/http"
"time"
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
+
hashicorpRaft "github.com/hashicorp/raft"
"github.com/seaweedfs/raft"
@@ -14,7 +15,7 @@ import (
func (ms *MasterServer) uiStatusHandler(w http.ResponseWriter, r *http.Request) {
infos := make(map[string]interface{})
- infos["Up Time"] = time.Now().Sub(startTime).String()
+ infos["Up Time"] = time.Since(startTime).Truncate(time.Second).String()
infos["Max Volume Id"] = ms.Topo.GetMaxVolumeId()
ms.Topo.RaftServerAccessLock.RLock()
diff --git a/weed/server/volume_server_handlers_ui.go b/weed/server/volume_server_handlers_ui.go
index 5679eb4834..a8dabf5072 100644
--- a/weed/server/volume_server_handlers_ui.go
+++ b/weed/server/volume_server_handlers_ui.go
@@ -18,7 +18,7 @@ import (
func (vs *VolumeServer) uiStatusHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Server", "SeaweedFS Volume "+version.VERSION)
infos := make(map[string]interface{})
- infos["Up Time"] = time.Now().Sub(startTime).String()
+ infos["Up Time"] = time.Since(startTime).Truncate(time.Second).String()
var ds []*volume_server_pb.DiskStatus
for _, loc := range vs.store.Locations {
if dir, e := filepath.Abs(loc.Directory); e == nil {