Skip to content

Commit 1a745bd

Browse files
authored
Merge pull request #29 from go-graphite/rebalance/use-mps-when-reset
rebalance: use -metrics-per-second when resetting sync speed with health check
2 parents 9f5b3dc + 1c1ec56 commit 1a745bd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

buckytools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package buckytools
22

33
const (
44
// Buckytools suite version
5-
Version = "0.4.2"
5+
Version = "0.5.2"
66
)
77

88
// SupportedHashTypes is the string identifiers of the hashing algorithms

cmd/bucky/common_sync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,11 @@ func (ms *metricSyncer) newGoCarbonState(addr string, speedUpInterval int) *goCa
492492
for {
493493
select {
494494
case <-state.fastReset:
495-
atomic.StoreInt64(&state.metricsPerSecond, 1)
495+
atomic.StoreInt64(&state.metricsPerSecond, mps)
496496
speed.Reset(time.Second / time.Duration(state.metricsPerSecond))
497497
case <-speedUp.C:
498498
if ms.isGoCarbonOverload(state) { // overload check
499-
atomic.StoreInt64(&state.metricsPerSecond, 1)
499+
atomic.StoreInt64(&state.metricsPerSecond, mps)
500500
} else if !ms.flags.noRandomEasing &&
501501
atomic.LoadInt64(&state.metricsPerSecond) >= 30 &&
502502
rand.Intn(10) <= 2 { // random easing

0 commit comments

Comments
 (0)