remove hard timeout limits and use only accrual failure detection

License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
This commit is contained in:
Adrian Lanzafame 2019-04-30 12:06:01 +10:00
parent 4b114dffe1
commit 9464759ae6
No known key found for this signature in database
GPG Key ID: 87E40C5D62EAE192
2 changed files with 8 additions and 4 deletions

View File

@ -1073,7 +1073,9 @@ func TestClustersReplicationOverall(t *testing.T) {
}
if numLocal != nClusters-1 {
t.Errorf("Expected %d local pins but got %d", nClusters-1, numLocal)
t.Error(pinfos)
for _, pi := range pinfos {
t.Errorf("%+v", pi)
}
}
if numRemote != 1 {

View File

@ -63,9 +63,11 @@ func (mc *Checker) CheckPeers(peers []peer.ID) error {
// and no alert has been sent before.
func (mc Checker) CheckAll() error {
for _, metric := range mc.metrics.AllMetrics() {
err := mc.alertIfExpired(metric)
if err != nil {
return err
if mc.FailedMetric(metric.Name, metric.Peer) {
err := mc.alert(metric.Peer, metric.Name)
if err != nil {
return err
}
}
}