diff options
author | KodApa85 <parsons151185@gmail.com> | 2018-04-27 13:48:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 13:48:47 +0100 |
commit | a40bb72e78755891ec84f5a4378c30114dae8316 (patch) | |
tree | 5e057527f163fa1bea10cbdc7318b035ff939200 /lib/oxidized/jobs.rb | |
parent | dbbe6af563072b62e373a9824c6a23482d20896e (diff) | |
parent | f530a50a949310aa9996d764eeaaba7458b7d6b6 (diff) |
Merge branch 'master' into xgs4600-cli
Diffstat (limited to 'lib/oxidized/jobs.rb')
-rw-r--r-- | lib/oxidized/jobs.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/oxidized/jobs.rb b/lib/oxidized/jobs.rb index c566778..fdc1cbf 100644 --- a/lib/oxidized/jobs.rb +++ b/lib/oxidized/jobs.rb @@ -6,7 +6,7 @@ module Oxidized def initialize max, interval, nodes @max = max - # Set interval to 1 if interval is 0 (=disabled) so we don't break + # Set interval to 1 if interval is 0 (=disabled) so we don't break # the 'ceil' function @interval = interval == 0 ? 1 : interval @nodes = nodes @@ -28,7 +28,7 @@ module Oxidized @durations.fill AVERAGE_DURATION, @durations.size...@nodes.size end @durations.push(last).shift - @duration = @durations.inject(:+).to_f / @nodes.size #rolling average + @duration = @durations.inject(:+).to_f / @nodes.size # rolling average new_count end @@ -45,9 +45,8 @@ module Oxidized # and c) there is more than MAX_INTER_JOB_GAP since last one was started # then we want one more thread (rationale is to fix hanging thread causing HOLB) if @want <= size and @want < @nodes.size - @want +=1 if (Time.now.utc - @last) > MAX_INTER_JOB_GAP + @want += 1 if (Time.now.utc - @last) > MAX_INTER_JOB_GAP end end - end end |