func (h *discoverProviderHealer) Probability() float64 {
	if h.previousHostListSize < h.node.CountReachableMembers() {
		h.previousHostListSize = h.node.CountReachableMembers()
	}
	if h.previousHostListSize < 1 {
		h.previousHostListSize = 1
	}
	return h.baseProbabillity / float64(h.previousHostListSize)
}
Probability returns the probability when a heal should be attempted
we want to throttle the heal attempts to alleviate pressure on the
discover provider.
package swim
import (
	"errors"
	"math/rand"
	"time"
	log "github.com/uber-common/bark"
	"github.com/uber/ringpop-go/logging"
	"github.com/uber/ringpop-go/util"
)
type discoverProviderHealer struct {
	node *Node
	baseProbabillity float64
	period           time.Duration
	previousHostListSize int
	quit                 chan struct{}
	started              chan struct{}
	logger log.Logger
	rand *rand.Rand
}
func newDiscoverProviderHealer(n *Node, baseProbability float64, period time.Duration) *discoverProviderHealer {
	return &discoverProviderHealer{
		node:             n,
		baseProbabillity: baseProbability,
		period:           period,
		logger:           logging.Logger("healer").WithField("local", n.Address()),
		started:          make(chan struct{}, 1),
		quit:             make(chan struct{}),
		rand:             rand.New(rand.NewSource(n.clock.Now().UnixNano())),
	}
}
func (h *discoverProviderHealer) Start() {
	select {
	case h.started <- struct{}{}:
	default:
		return
	}
	go func() {
		for {
			select {
			case <-h.node.clock.After(h.period):
			case <-h.quit:
				return
			}
			if h.rand.Float64() < h.Probability() {
				h.Heal()
			}
		}
	}()
}
func (h *discoverProviderHealer) Stop() {
	select {
	case <-h.started:
		h.quit <- struct{}{}
	default:
	}
}