lib/riemann/babbler/plugins/cpu.rb in riemann-babbler-0.8.8 vs lib/riemann/babbler/plugins/cpu.rb in riemann-babbler-0.8.9

- old
+ new

@@ -16,10 +16,10 @@ File.read('/proc/stat').split("\n").each do |cpu_line| # проверяем есть строчка /cpu\d+/ или /cpu / и сграбливаем это в переменную cpu_number = cpu_line.scan(/cpu(\d+|\s)\s+/) next if cpu_number.empty? - cpu_number = cpu_number[0][0] == " " ? "_total" : cpu_number[0][0] + cpu_number = cpu_number[0][0] == ' ' ? '_total' : cpu_number[0][0] # работаем со строкой cpu_line[/cpu(\d+|\s)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/] _, u2, n2, s2, i2 = [$1, $2, $3, $4, $5].map { |e| e.to_i }