mirror of https://github.com/statping/statping
fix: OnlineSince Calculation
parent
aa515545db
commit
56f190cb31
|
@ -287,12 +287,8 @@ func (s *Service) OnlineSince(ago time.Time) float32 {
|
|||
return s.Online24Hours
|
||||
}
|
||||
|
||||
avg := (float64(failsList) / float64(hitsList)) * 100
|
||||
avg = 100 - avg
|
||||
if avg < 0 {
|
||||
avg = 0
|
||||
}
|
||||
amount, _ := strconv.ParseFloat(fmt.Sprintf("%0.2f", avg), 10)
|
||||
amount := (hitsList / totalList) * 100
|
||||
|
||||
s.Online24Hours = float32(amount)
|
||||
return s.Online24Hours
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue