extend the initial size of metrics distribution to 5

This prevents accrual failure detection from kicking in too
soon after a cluster has started.

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
This commit is contained in:
Adrian Lanzafame 2019-05-07 19:07:08 +10:00
parent 4f0e3c85ff
commit a763560e0c
No known key found for this signature in database
GPG Key ID: 87E40C5D62EAE192

View File

@ -164,7 +164,7 @@ func (mc *Checker) failed(metric string, pid peer.ID) (float64, []float64, float
// alerting/failure detection will fallback to the metric-expiring
// method
switch {
case len(dv) < 2 && !latest.Expired():
case len(dv) < 5 && !latest.Expired():
return float64(v), dv, 0.0, false
default:
phiv := phi(float64(v), dv)