class Aio::Module::Cmd::Maipu::ShowMemory
Public Class Methods
new()
click to toggle source
Calls superclass method
Aio::Module::Cmd::new
# File lib/modules/cmd/maipu/show_memory.rb, line 8 def initialize super({ :cmd_full => "show memory", :cmd_short => "sh mem", :author => "Elin", :description => "This is Maipu Command# show memory", :ranking => Ranking_1, :platform => "all", :benchmark => { :used_percent => ["<", 70.0], } }) end
Public Instance Methods
parse()
click to toggle source
# File lib/modules/cmd/maipu/show_memory.rb, line 22 def parse cont = self.context.dup useful[:memory] = {} cont.readline_match_block(/STATISTICS/) {|b|b} cont.readline_match_block(/(?<used_percent>\d+[\.]\d+)%/) do |block| block.warning_serious(useful[:memory], :used_percent, self) end end