Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

Commit

Permalink
Use nowFn for time
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Wang committed Jan 11, 2018
1 parent 5d6445c commit 996d0ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion service/r2/service.go
Expand Up @@ -235,7 +235,7 @@ func (s *service) handleRoute(rf routeFunc, r *http.Request, namespace string) (
}
start := s.nowFn()
data, err := rf(s, r)
t := time.Since(start)
t := s.nowFn().Sub(start)
s.metrics.recordMetric(r.RequestURI, r.Method, namespace, t, err)
s.logRequest(r.RequestURI, r.Method, namespace, t, err)
if err != nil {
Expand Down

0 comments on commit 996d0ac

Please sign in to comment.