Class: Iostat
- Inherits:
-
Object
- Object
- Iostat
- Defined in:
- lib/iostat.rb
Instance Attribute Summary collapse
-
#disk_name ⇒ Object
readonly
Returns the value of attribute disk_name.
-
#r_await ⇒ Object
readonly
Returns the value of attribute r_await.
-
#util ⇒ Object
readonly
Returns the value of attribute util.
-
#w_await ⇒ Object
readonly
Returns the value of attribute w_await.
Instance Method Summary collapse
-
#initialize(path) ⇒ Iostat
constructor
A new instance of Iostat.
- #run ⇒ Object
- #stop ⇒ Object
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_name ⇒ Object (readonly)
Returns the value of attribute disk_name.
5 6 7 |
# File 'lib/iostat.rb', line 5 def disk_name @disk_name end |
#r_await ⇒ Object (readonly)
Returns the value of attribute r_await.
5 6 7 |
# File 'lib/iostat.rb', line 5 def r_await @r_await end |
#util ⇒ Object (readonly)
Returns the value of attribute util.
5 6 7 |
# File 'lib/iostat.rb', line 5 def util @util end |
#w_await ⇒ Object (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
#run ⇒ Object
15 16 17 18 19 20 |
# File 'lib/iostat.rb', line 15 def run @run = true Thread.new do disk_await_monitor end end |
#stop ⇒ Object
22 23 24 |
# File 'lib/iostat.rb', line 22 def stop @run = false end |