clean SinceInMicroseconds, convert to SinceInSeconds

Kubernetes-commit: ab182552b485ceed96c3b05d284ae9480377daf8
This commit is contained in:
danielqsj 2019-04-15 16:18:01 +08:00 committed by Kubernetes Publisher
parent b31ce5f20e
commit 669e87efbe
2 changed files with 0 additions and 6 deletions

View File

@ -282,7 +282,6 @@ func MonitorRequest(req *http.Request, verb, group, version, resource, subresour
reportedVerb := cleanVerb(verb, req)
dryRun := cleanDryRun(req.URL)
client := cleanUserAgent(utilnet.GetHTTPClient(req))
elapsedMicroseconds := float64(elapsed / time.Microsecond)
elapsedSeconds := elapsed.Seconds()
requestCounter.WithLabelValues(reportedVerb, dryRun, group, version, resource, subresource, scope, component, client, contentType, codeToString(httpCode)).Inc()
deprecatedRequestCounter.WithLabelValues(reportedVerb, group, version, resource, subresource, scope, component, client, contentType, codeToString(httpCode)).Inc()

View File

@ -150,11 +150,6 @@ func RecordDataKeyGeneration(start time.Time, err error) {
dataKeyGenerationLatencies.Observe(sinceInSeconds(start))
}
// sinceInMicroseconds gets the time since the specified start in microseconds.
func sinceInMicroseconds(start time.Time) float64 {
return float64(time.Since(start).Nanoseconds() / time.Microsecond.Nanoseconds())
}
// sinceInSeconds gets the time since the specified start in seconds.
func sinceInSeconds(start time.Time) float64 {
return time.Since(start).Seconds()