Sha256: e6ccd52f04b6e8f891be2db5fe2a96e5831f4ce32f2e58f7789b99808fd44fe8

Contents?: true

Size: 294 Bytes

Versions: 3

Compression:

Stored size: 294 Bytes

Contents

# Fact: uptime_hours
#
# Purpose: Return purely number of hours of uptime.
#
# Resolution: Divides uptime_seconds fact by 3600.
#
# Caveats:
#

Facter.add(:uptime_hours) do
  setcode do
    seconds = Facter.value(:uptime_seconds)
    seconds && seconds / (60 * 60) # seconds in hour
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facter-1.6.2 lib/facter/uptime_hours.rb
facter-1.6.1 lib/facter/uptime_hours.rb
facter-1.6.0 lib/facter/uptime_hours.rb