Skip to content

Commit

Permalink
Merge pull request #29 from go-graphite/rebalance/use-mps-when-reset
Browse files Browse the repository at this point in the history
rebalance: use -metrics-per-second when resetting sync speed with health check
  • Loading branch information
bom-d-van authored Nov 11, 2021
2 parents 9f5b3dc + 1c1ec56 commit 1a745bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buckytools.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package buckytools

const (
// Buckytools suite version
Version = "0.4.2"
Version = "0.5.2"
)

// SupportedHashTypes is the string identifiers of the hashing algorithms
Expand Down
4 changes: 2 additions & 2 deletions cmd/bucky/common_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,11 @@ func (ms *metricSyncer) newGoCarbonState(addr string, speedUpInterval int) *goCa
for {
select {
case <-state.fastReset:
atomic.StoreInt64(&state.metricsPerSecond, 1)
atomic.StoreInt64(&state.metricsPerSecond, mps)
speed.Reset(time.Second / time.Duration(state.metricsPerSecond))
case <-speedUp.C:
if ms.isGoCarbonOverload(state) { // overload check
atomic.StoreInt64(&state.metricsPerSecond, 1)
atomic.StoreInt64(&state.metricsPerSecond, mps)
} else if !ms.flags.noRandomEasing &&
atomic.LoadInt64(&state.metricsPerSecond) >= 30 &&
rand.Intn(10) <= 2 { // random easing
Expand Down

0 comments on commit 1a745bd

Please sign in to comment.