mirror of https://github.com/statping/statping
Merge pull request #1 from dipeshhkc/fix-online-since-calc-patch-1
fix: OnlineSince Calculationpull/1080/head
commit
9c07ec46c3
|
@ -287,12 +287,8 @@ func (s *Service) OnlineSince(ago time.Time) float32 {
|
||||||
return s.Online24Hours
|
return s.Online24Hours
|
||||||
}
|
}
|
||||||
|
|
||||||
avg := (float64(failsList) / float64(hitsList)) * 100
|
amount := (hitsList / totalList) * 100
|
||||||
avg = 100 - avg
|
|
||||||
if avg < 0 {
|
|
||||||
avg = 0
|
|
||||||
}
|
|
||||||
amount, _ := strconv.ParseFloat(fmt.Sprintf("%0.2f", avg), 10)
|
|
||||||
s.Online24Hours = float32(amount)
|
s.Online24Hours = float32(amount)
|
||||||
return s.Online24Hours
|
return s.Online24Hours
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue