Class: Custodian::Samplers::Load

Inherits:
Sampler
  • Object
show all
Defined in:
lib/custodian/samplers/linux/load.rb,
lib/custodian/samplers/darwin/load.rb

Class Method Summary collapse

Methods inherited from Sampler

compatible?, describe, description

Methods included from Utilities

directory_exists?, file_exists?, program_exists?

Class Method Details

.sampleObject



7
8
9
10
11
12
13
14
15
# File 'lib/custodian/samplers/linux/load.rb', line 7

def self.sample
  uptime = `uptime`.match /load average: ([0-9.]+), ([0-9.]+), ([0-9.]+)/

  {
    "Last 5 minutes"    => uptime[1],
    "Last 10 minutes"   => uptime[2],
    "Last 15 minutes"   => uptime[3]
  }
end