summaryrefslogtreecommitdiff
path: root/lib/oxidized/job.rb
blob: 0a4a24bc1886f448bc67a1a297562c06f666c3d9 (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
        @status, @config = @node.run
        @end             = Time.now.utc
        @time            = @end - @start
      end
    end
  end
end