Fix Div By 0 in Small Helper (#11390)

This commit is contained in:
Raul Jordan
2022-09-01 14:26:28 -04:00
committed by GitHub
parent a5da9aedd4
commit 65bf3d0fa8

View File

@@ -113,6 +113,9 @@ func (s *Service) updateMetrics() {
}
func average(xs []float64) float64 {
if len(xs) == 0 {
return 0
}
total := 0.0
for _, v := range xs {
total += v