Sha256: 3b76a1fae2ef0463acbfb8e92f92143d35c5b6114010190abf7e5ab69176e453

Contents?: true

Size: 424 Bytes

Versions: 4

Compression:

Stored size: 424 Bytes

Contents

class Eye::Checker::Runtime < Eye::Checker

  # check :runtime, :every => 1.minute, :below => 120.minutes

  param :below, [Fixnum, Float], true

  def get_value
    st = Eye::SystemResources.start_time(@pid)
    if st
      Time.now.to_i - st.to_i
    else
      0
    end
  end

  def human_value(value)
    "#{value / 60}m"
  end

  def good?(value)
    if below
      value < below
    else
      true
    end
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
reel-eye-0.5.1 lib/eye/checker/runtime.rb
eye-0.5.1 lib/eye/checker/runtime.rb
reel-eye-0.5 lib/eye/checker/runtime.rb
eye-0.5 lib/eye/checker/runtime.rb