summaryrefslogtreecommitdiff
path: root/lib/oxidized/job.rb
blob: 6fb60a80e83718d4fd85846cb6819429a44e7e8e (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