summaryrefslogtreecommitdiff
path: root/lib/oxidized/job.rb
blob: 6921c2b07436589b11ce5d0af8db9d8a414f36ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Oxidized
  class Job < Thread
    attr_reader :start, :end, :status, :time, :node, :config
    def initialize node
      @node         = node
      @start        = Time.now.utc
      super do |node|
        @status, @config = node.run 
        @end             = Time.now.utc
        @time            = @end - @start
      end
    end
  end
end