Class: ForemanMaintain::Utils::Disk::Stats
- Inherits:
-
Object
- Object
- ForemanMaintain::Utils::Disk::Stats
- Defined in:
- lib/foreman_maintain/utils/disk/stats.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #<<(io_obj) ⇒ Object
-
#initialize ⇒ Stats
constructor
A new instance of Stats.
- #stdout ⇒ Object
Constructor Details
#initialize ⇒ Stats
Returns a new instance of Stats.
7 8 9 |
# File 'lib/foreman_maintain/utils/disk/stats.rb', line 7 def initialize @data = {} end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/foreman_maintain/utils/disk/stats.rb', line 5 def data @data end |
Instance Method Details
#<<(io_obj) ⇒ Object
11 12 13 |
# File 'lib/foreman_maintain/utils/disk/stats.rb', line 11 def <<(io_obj) data[io_obj.dir] = io_obj.performance end |
#stdout ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/foreman_maintain/utils/disk/stats.rb', line 15 def stdout if data.keys.length > 1 data.map { |dir, perf| "#{dir} : #{perf}" }.join("\n") else "Disk speed : #{data.values.first}" end end |