26b55bc341
Astute needs to know how many nodes can be provisioned at a time, based on IOPS. Change-Id: If2cf35ac8195baf37cda50564b70ba3db836ccea Partial-Bug: #1355347
16 lines
394 B
Ruby
16 lines
394 B
Ruby
require 'facter'
|
|
|
|
# Requires sysstat package on Ubuntu and CentOS
|
|
# Fact iops totals tps values from iostat
|
|
|
|
Facter.add('iops') do
|
|
confine :kernel => :linux
|
|
str = Facter::Util::Resolution.exec("iostat | grep -v 'dm-'" \
|
|
" | awk '{print $2}'")
|
|
iops = 0
|
|
str.split("\n").each do |iops_val|
|
|
iops = iops + iops_val.to_f
|
|
end
|
|
setcode { iops }
|
|
end
|