Skip to content

Commit

Permalink
nsq_stat: fix 'division by zero' error for intervals less than 1s
Browse files Browse the repository at this point in the history
  • Loading branch information
nordicdyno committed Jan 17, 2015
1 parent d9d5d94 commit 77d8892
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/nsq_stat/nsq_stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ func statLoop(interval time.Duration, topic string, channel string,

// TODO: paused
fmt.Printf("%7d %7d | %7d %7d %7d %5d %5d | %7d %7d %12d %7d\n",
(c.MessageCount-o.MessageCount)/int64(interval.Seconds()),
(c.MessageCount-o.MessageCount-(c.Depth-o.Depth))/int64(interval.Seconds()),
int64(float64(c.MessageCount-o.MessageCount)/interval.Seconds()),
int64(float64(c.MessageCount-o.MessageCount-(c.Depth-o.Depth))/interval.Seconds()),
c.Depth,
c.MemoryDepth,
c.BackendDepth,
Expand Down

0 comments on commit 77d8892

Please sign in to comment.