Skip to content

Commit

Permalink
fix duration when err
Browse files Browse the repository at this point in the history
  • Loading branch information
lintanghui committed Mar 14, 2019
1 parent 18a75b3 commit ad50cd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proxy/proto/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ func (mp *msgPipe) pipe() {
msg.WithError(err) // NOTE: maybe err is nil
msg.Done()
if prom.On {
prom.HandleTime(nc.Cluster(), nc.Addr(), msg.Request().CmdString(), int64(msg.RemoteDur()/time.Microsecond))
if err != nil {
prom.ErrIncr(nc.Cluster(), nc.Addr(), msg.Request().CmdString(), perr.Cause(err).Error())
} else {
prom.HandleTime(nc.Cluster(), nc.Addr(), msg.Request().CmdString(), int64(msg.RemoteDur()/time.Microsecond))
}
}
}
Expand Down

0 comments on commit ad50cd1

Please sign in to comment.