aboutsummaryrefslogtreecommitdiff
path: root/weed/command/volume.go
diff options
context:
space:
mode:
authorstlpmo <hq-STLPMO@chinaunicom.cn>2019-11-29 15:17:17 +0800
committerstlpmo <hq-STLPMO@chinaunicom.cn>2019-11-29 15:17:17 +0800
commitea9d1ebd2f05c5fc55186c5e624585f1eddf5b68 (patch)
tree9686df0a00d7e3015292c5269a63eb2bfdce98da /weed/command/volume.go
parent753138a3f7828b85d2fbaeb265d912dfc49fc2bd (diff)
downloadseaweedfs-ea9d1ebd2f05c5fc55186c5e624585f1eddf5b68.tar.xz
seaweedfs-ea9d1ebd2f05c5fc55186c5e624585f1eddf5b68.zip
resolve the Duration.Milliseconds() is not exist in golang v11 & v12
Diffstat (limited to 'weed/command/volume.go')
-rw-r--r--weed/command/volume.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/weed/command/volume.go b/weed/command/volume.go
index f016a89ae..3e8341ef8 100644
--- a/weed/command/volume.go
+++ b/weed/command/volume.go
@@ -186,22 +186,26 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
if err := publicHttpDown.Stop(); err != nil {
glog.Warningf("stop the public http server failed, %v", err)
}
- glog.V(0).Infof("graceful stop public http server, elapsed [%d]", time.Now().Sub(startTime).Milliseconds())
+ delta := time.Now().Sub(startTime).Nanoseconds() / 1e6
+ glog.V(0).Infof("stop public http server, elapsed %dms", delta)
}
startTime = time.Now()
if err := clusterHttpServer.Stop(); err != nil {
glog.Warningf("stop the cluster http server failed, %v", err)
}
- glog.V(0).Infof("graceful stop cluster http server, elapsed [%d]", time.Now().Sub(startTime).Milliseconds())
+ delta := time.Now().Sub(startTime).Nanoseconds() / 1e6
+ glog.V(0).Infof("graceful stop cluster http server, elapsed [%d]", delta)
startTime = time.Now()
grpcS.GracefulStop()
- glog.V(0).Infof("graceful stop gRPC, elapsed [%d]", time.Now().Sub(startTime).Milliseconds())
+ delta = time.Now().Sub(startTime).Nanoseconds() / 1e6
+ glog.V(0).Infof("graceful stop gRPC, elapsed [%d]", delta)
startTime = time.Now()
volumeServer.Shutdown()
- glog.V(0).Infof("stop volume server, elapsed [%d]", time.Now().Sub(startTime).Milliseconds())
+ delta = time.Now().Sub(startTime).Nanoseconds() / 1e6
+ glog.V(0).Infof("stop volume server, elapsed [%d]", delta)
pprof.StopCPUProfile()