increase decaying tag interval
This commit is contained in:
parent
f87e7b72d7
commit
51369f756f
|
@ -30,7 +30,7 @@ var (
|
|||
GossipSubConnTagBumpMessageDelivery = 1
|
||||
|
||||
// GossipSubConnTagDecayInterval is the decay interval for decaying connection manager tags.
|
||||
GossipSubConnTagDecayInterval = time.Minute
|
||||
GossipSubConnTagDecayInterval = 10 * time.Minute
|
||||
|
||||
// GossipSubConnTagDecayAmount is subtracted from decaying tag values at each decay interval.
|
||||
GossipSubConnTagDecayAmount = 1
|
||||
|
@ -50,9 +50,7 @@ var (
|
|||
// - For each message that we receive, we bump a delivery tag for peer that delivered the message
|
||||
// first.
|
||||
// The delivery tags have a maximum value, GossipSubConnTagMessageDeliveryCap, and they decay at
|
||||
// a rate of GossipSubConnTagDecayAmount / GossipSubConnTagDecayInterval (default 1/minute).
|
||||
// With the defaults, a peer who stops delivering messages will have their delivery tag decay to zero
|
||||
// in fifteen minutes.
|
||||
// a rate of GossipSubConnTagDecayAmount / GossipSubConnTagDecayInterval.
|
||||
type tagTracer struct {
|
||||
sync.Mutex
|
||||
|
||||
|
|
|
@ -122,8 +122,8 @@ func TestTagTracerDeliveryTags(t *testing.T) {
|
|||
t.Errorf("expected delivery tag value = %d, got %d", expected, val)
|
||||
}
|
||||
|
||||
// if we jump forward a few minutes, we should see the tags decrease by 1 / minute
|
||||
clk.Add(5 * time.Minute)
|
||||
// if we jump forward a few minutes, we should see the tags decrease by 1 / 10 minutes
|
||||
clk.Add(50 * time.Minute)
|
||||
|
||||
val = getTagValue(cmgr, p, "pubsub-deliveries:topic-1")
|
||||
expected = GossipSubConnTagMessageDeliveryCap - 5
|
||||
|
|
Loading…
Reference in New Issue