Class: Iostat

Inherits:
Object
  • Object
show all
Defined in:
lib/iostat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Iostat

Returns a new instance of Iostat.



6
7
8
9
10
11
12
13
# File 'lib/iostat.rb', line 6

def initialize(path)
  @path = path
  @w_await = 0
  @r_await = 0
  @util = 0
  @disk_name = 'unknown'
  run
end

Instance Attribute Details

#disk_nameObject (readonly)

Returns the value of attribute disk_name.



5
6
7
# File 'lib/iostat.rb', line 5

def disk_name
  @disk_name
end

#r_awaitObject (readonly)

Returns the value of attribute r_await.



5
6
7
# File 'lib/iostat.rb', line 5

def r_await
  @r_await
end

#utilObject (readonly)

Returns the value of attribute util.



5
6
7
# File 'lib/iostat.rb', line 5

def util
  @util
end

#w_awaitObject (readonly)

Returns the value of attribute w_await.



5
6
7
# File 'lib/iostat.rb', line 5

def w_await
  @w_await
end

Instance Method Details

#runObject



15
16
17
18
19
20
# File 'lib/iostat.rb', line 15

def run
  @run = true
  Thread.new do
    disk_await_monitor
  end
end

#stopObject



22
23
24
# File 'lib/iostat.rb', line 22

def stop
  @run = false
end