diff options
author | Saku Ytti <saku@ytti.fi> | 2015-02-22 12:28:08 +0200 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2015-02-22 12:28:08 +0200 |
commit | 33124f2570a4d8c4dfa153120dbc06b3c725a25c (patch) | |
tree | 0dddfefcc3d4667611ec7229713aa403760b8ba3 /lib/oxidized/jobs.rb | |
parent | 72096d90e6d85306418ed4e3385a657b4056d3bc (diff) |
run #duration not #new_count
@duration isn't set before #duration is ran
Diffstat (limited to 'lib/oxidized/jobs.rb')
-rw-r--r-- | lib/oxidized/jobs.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/oxidized/jobs.rb b/lib/oxidized/jobs.rb index 0511b49..3342679 100644 --- a/lib/oxidized/jobs.rb +++ b/lib/oxidized/jobs.rb @@ -1,12 +1,13 @@ module Oxidized class Jobs < Array + AVERAGE_DURATION = 5 # initially presume nodes take 5s to complete attr_accessor :interval, :max, :want def initialize max, interval, nodes @max = max @interval = interval @nodes = nodes - @durations = Array.new(@nodes.size, 5) # guess that nodes take 5s - new_count + @durations = Array.new @nodes.size, AVERAGE_DURATION + duration AVERAGE_DURATION super() end def duration last |