Skip to content

Commit

Permalink
Printing duration in microseconds (ContentSquare#70)
Browse files Browse the repository at this point in the history
Unit for printing is currently inconsistent. Making it consistent to print in Microseconds.

Consistent time unit in response time logging
  • Loading branch information
amitsharma10 authored and valyala committed Nov 20, 2019
1 parent 2a8a733 commit 41cab10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ func newScope(req *http.Request, u *user, c *cluster, cu *clusterUser) *scope {
}

func (s *scope) String() string {
return fmt.Sprintf("[ Id: %s; User %q(%d) proxying as %q(%d) to %q(%d); RemoteAddr: %q; LocalAddr: %q; Duration: %s ]",
return fmt.Sprintf("[ Id: %s; User %q(%d) proxying as %q(%d) to %q(%d); RemoteAddr: %q; LocalAddr: %q; Duration: %s μs]",
s.id,
s.user.name, s.user.queryCounter.load(),
s.clusterUser.name, s.clusterUser.queryCounter.load(),
s.host.addr.Host, s.host.load(),
s.remoteAddr, s.localAddr, time.Since(s.startTime))
s.remoteAddr, s.localAddr, time.Since(s.startTime).Nanoseconds() / 1000.0 )
}

func (s *scope) incQueued() error {
Expand Down

0 comments on commit 41cab10

Please sign in to comment.