Skip to content

Add option to disable staggering - #698

Merged
shortdudey123 merged 2 commits into
python-diamond:masterfrom
DStape:add-option-to-disable-staggering
Dec 29, 2021
Merged

shortdudey123 merged 2 commits into
python-diamond:masterfrom
DStape:add-option-to-disable-staggering

Conversation

@DStape

@DStape DStape commented Feb 28, 2018

Copy link
Copy Markdown
Contributor

No description provided.

David Stapleton added 2 commits February 28, 2018 21:06
The stagger functionality was added in 87da1c5. This works, however in
cases where only one collector is configured, it's possible that the
maximum collection time calculated is not long enough and the collection
is terminated with, "Took too long to run!". This is despite the fact
that the configured interval gives more than enough time for the
collector to finish its run.

Therefore, add a new 'stagger_collection' option that stops this
behaviour. When disabled/cleared/set to false, the maximum collection
time will remain static, or in other words it will be set to the
interval configured and will not be increased if the collector doesn't
finish within this time period.

This change could potentially screw up existing deployments that rely on
the existing stagger functionality, so by default 'stagger_collection'
is enabled.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.009%) to 24.676% when pulling 2c75ab2 on DStape:add-option-to-disable-staggering into f2bece4 on python-diamond:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.009%) to 24.676% when pulling 2c75ab2 on DStape:add-option-to-disable-staggering into f2bece4 on python-diamond:master.

next_window = math.floor(time.time() / interval) * interval
stagger_offset = random.uniform(0, interval - 1)

if str_to_bool(self.config['stagger_collection']):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this needs to be collector.config['stagger_collection'] instead of self.

But I have no capacity or ability to test this.

shortdudey123 added a commit that referenced this pull request Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants