Fix unnecessary conversions

This commit is contained in:
Manuel Rüger 2020-08-21 10:56:18 +02:00
parent 19a5b1a31c
commit 4d1fc8d6ec
2 changed files with 2 additions and 2 deletions

View File

@ -722,7 +722,7 @@ func (nsc *NetworkServicesController) publishMetrics(serviceInfoMap serviceInfoM
endTime := time.Since(start)
glog.V(2).Infof("Publishing IPVS metrics took %v", endTime)
if nsc.MetricsEnabled {
metrics.ControllerIpvsMetricsExportTime.Observe(float64(endTime.Seconds()))
metrics.ControllerIpvsMetricsExportTime.Observe(endTime.Seconds())
}
}()

View File

@ -110,7 +110,7 @@ func (hc *HealthController) HandleHeartbeat(beat *ControllerHeartbeat) {
// CheckHealth evaluates the time since last heartbeat to decide if the controller is running or not
func (hc *HealthController) CheckHealth() bool {
health := true
graceTime := time.Duration(1500 * time.Millisecond)
graceTime := time.Duration(1500) * time.Millisecond
if hc.Config.RunFirewall {
if time.Since(hc.Status.NetworkPolicyControllerAlive) > hc.Config.IPTablesSyncPeriod+hc.Status.NetworkPolicyControllerAliveTTL+graceTime {