summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2015-02-22 12:28:08 +0200
committerSaku Ytti <saku@ytti.fi>2015-02-22 12:28:08 +0200
commit33124f2570a4d8c4dfa153120dbc06b3c725a25c (patch)
tree0dddfefcc3d4667611ec7229713aa403760b8ba3 /lib
parent72096d90e6d85306418ed4e3385a657b4056d3bc (diff)
run #duration not #new_count
@duration isn't set before #duration is ran
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/jobs.rb5
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