should use time.Since instead of time.Now().Sub

This commit is contained in:
wangguoliang 2017-08-21 10:03:18 +08:00
parent e633a1604f
commit c2ed2bc21c
3 changed files with 3 additions and 3 deletions

View File

@ -560,7 +560,7 @@ func (dc *DeploymentController) syncDeployment(key string) error {
startTime := time.Now()
glog.V(4).Infof("Started syncing deployment %q (%v)", key, startTime)
defer func() {
glog.V(4).Infof("Finished syncing deployment %q (%v)", key, time.Now().Sub(startTime))
glog.V(4).Infof("Finished syncing deployment %q (%v)", key, time.Since(startTime))
}()
namespace, name, err := cache.SplitMetaNamespaceKey(key)

View File

@ -123,7 +123,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaler scalability [Slow]", fun
}
break
}
glog.Infof("Made nodes schedulable again in %v", time.Now().Sub(s).String())
glog.Infof("Made nodes schedulable again in %v", time.Since(s).String())
})
It("should scale up at all [Feature:ClusterAutoscalerScalability1]", func() {

View File

@ -145,7 +145,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
}
break
}
glog.Infof("Made nodes schedulable again in %v", time.Now().Sub(s).String())
glog.Infof("Made nodes schedulable again in %v", time.Since(s).String())
})
It("shouldn't increase cluster size if pending pod is too large [Feature:ClusterSizeAutoscalingScaleUp]", func() {