Skip to content

Commit

Permalink
mozzle: Avoid division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo0mer committed Feb 28, 2017
1 parent 3ea4103 commit f68fa94
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ func forApp(app application, m Metric) Metric {
}

func ratio(part, whole uint64) float64 {
if whole == 0 {
return 0.0
}
return float64(part) / float64(whole)
}

Expand Down

0 comments on commit f68fa94

Please sign in to comment.