()
| 25 | } |
| 26 | |
| 27 | func (s *opStats) OpStats() *OpStats { |
| 28 | o := &OpStats{ |
| 29 | OpStr: s.opstr, |
| 30 | Calls: s.calls.Int64(), |
| 31 | Usecs: s.nsecs.Int64() / 1e3, |
| 32 | Fails: s.fails.Int64(), |
| 33 | } |
| 34 | if o.Calls != 0 { |
| 35 | o.UsecsPercall = o.Usecs / o.Calls |
| 36 | } |
| 37 | o.RedisErrType = s.redis.errors.Int64() |
| 38 | return o |
| 39 | } |
| 40 | |
| 41 | type OpStats struct { |
| 42 | OpStr string `json:"opstr"` |