diff options
author | Wild Kat <wk@futureinquestion.net> | 2018-04-21 13:27:05 +0200 |
---|---|---|
committer | Wild Kat <wk@futureinquestion.net> | 2018-04-21 13:35:54 +0200 |
commit | 21e3d6490496573f25ef77fe8172766ac7d1a736 (patch) | |
tree | 785e5243f5f7ffe7e5a4bfcde551ec04c723b2ae /lib/oxidized/jobs.rb | |
parent | 2648b1bb271727976e2d96123fcd51d52af39f79 (diff) |
the great makeover - standardize layout, alignment, indentation
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 |