diff --git a/command/agent/config.go b/command/agent/config.go index 581cf9ca4..48b347c33 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -263,12 +263,6 @@ type Config struct { CheckUpdateInterval time.Duration `mapstructure:"-"` CheckUpdateIntervalRaw string `mapstructure:"check_update_interval" json:"-"` - // CheckUpdateStagger enables a randomization of the CheckUpdateInterval between - // .5 and 1.5 of that interval. This is useful if checks happen often to stagger - // writes and pervent them from all executing at the end of the same CheckUpdateInterval. - // Off by default. - CheckUpdateStagger bool `mapstructure:"check_update_stagger"` - // ACLToken is the default token used to make requests if a per-request // token is not provided. If not configured the 'anonymous' token is used. ACLToken string `mapstructure:"acl_token" json:"-"` @@ -930,9 +924,6 @@ func MergeConfig(a, b *Config) *Config { if b.CheckUpdateIntervalRaw != "" || b.CheckUpdateInterval != 0 { result.CheckUpdateInterval = b.CheckUpdateInterval } - if b.CheckUpdateStagger { - result.CheckUpdateStagger = true - } if b.SyslogFacility != "" { result.SyslogFacility = b.SyslogFacility } diff --git a/command/agent/config_test.go b/command/agent/config_test.go index c21070d4e..945e2152d 100644 --- a/command/agent/config_test.go +++ b/command/agent/config_test.go @@ -494,17 +494,6 @@ func TestDecodeConfig(t *testing.T) { t.Fatalf("bad: %#v", config) } - // CheckUpdateStagger - input = `{"check_update_stagger": true}` - config, err = DecodeConfig(bytes.NewReader([]byte(input))) - if err != nil { - t.Fatalf("err: %s", err) - } - - if !config.CheckUpdateStagger { - t.Fatalf("bad: %#v", config) - } - // ACLs input = `{"acl_token": "1234", "acl_datacenter": "dc2", "acl_ttl": "60s", "acl_down_policy": "deny", diff --git a/command/agent/local.go b/command/agent/local.go index ea4e40db8..0643776ea 100644 --- a/command/agent/local.go +++ b/command/agent/local.go @@ -208,12 +208,7 @@ func (l *localState) UpdateCheck(checkID, status, output string) { if l.config.CheckUpdateInterval > 0 && check.Status == status { check.Output = output if _, ok := l.deferCheck[checkID]; !ok { - var intv time.Duration - if l.config.CheckUpdateStagger { - intv = time.Duration(uint64(l.config.CheckUpdateInterval)/2) + randomStagger(l.config.CheckUpdateInterval) - } else { - intv = l.config.CheckUpdateInterval - } + intv := time.Duration(uint64(l.config.CheckUpdateInterval)/2) + randomStagger(l.config.CheckUpdateInterval) deferSync := time.AfterFunc(intv, func() { l.Lock() if _, ok := l.checkStatus[checkID]; ok { diff --git a/website/source/docs/agent/options.html.markdown b/website/source/docs/agent/options.html.markdown index 51dd8f397..8c36fec31 100644 --- a/website/source/docs/agent/options.html.markdown +++ b/website/source/docs/agent/options.html.markdown @@ -353,12 +353,6 @@ definitions support being updated during a reload. reduce write pressure. If a check ever changes state, the new state and associated output is synchronized immediately. To disable this behavior, set the value to "0s". -* `check_update_stagger` - CheckUpdateStagger enables a randomization of the CheckUpdateInterval between - .5 and 1.5 of that interval. This is useful if checks happen often to stagger - writes and pervent them from all executing at the end of the same CheckUpdateInterval. - Off by default. - * `client_addr` Equivalent to the [`-client` command-line flag](#_client).