Skip to content

Commit

Permalink
don't emit member stat on change during bootstrapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Dijk committed Mar 10, 2017
1 parent 33075b6 commit 1e99497
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions ringpop.go
Expand Up @@ -477,11 +477,16 @@ func (rp *Ringpop) HandleEvent(event events.Event) {
}
rp.statter.IncCounter(rp.getStatKey("membership-set."+status), nil, 1)
}
mc, err := rp.CountReachableMembers()
if err != nil {
rp.logger.Errorf("unable to count members of the ring for statting: %q", err)
} else {
rp.statter.UpdateGauge(rp.getStatKey("num-members"), nil, int64(mc))
// During bootstrapping ringpop is not ready causing errors from
// CountReachableMembers. When this is logged it would confuse people
// thinking that there is a problem with ringpop bootstrapping
if rp.Ready() {
mc, err := rp.CountReachableMembers()
if err != nil {
rp.logger.Errorf("unable to count members of the ring for statting: %q", err)
} else {
rp.statter.UpdateGauge(rp.getStatKey("num-members"), nil, int64(mc))
}
}
rp.statter.IncCounter(rp.getStatKey("updates"), nil, int64(len(event.Changes)))

Expand Down

0 comments on commit 1e99497

Please sign in to comment.