This commit is contained in:
mwiegand 2021-11-05 18:49:03 +01:00
parent d96fb7afa4
commit ad8228ff8f

View file

@ -1,6 +1,6 @@
dir = ENV.fetch("PROCIO_DIR", "/proc")
hostname = ENV.fetch("PROCIO_HOSTNAME", "/proc")
result = {} of String => Hash(Symbol, UInt64)
time = Time.local.to_s("%s%9N")
Dir.entries(dir).each do |entry|
entry =~ /^\d+$/ || next
@ -17,8 +17,6 @@ Dir.entries(dir).each do |entry|
end
end
time = Time.local.to_s("%s%9N")
result.each do |comm, v|
if v[:r] + v[:w] > 0
puts %(procio comm="#{comm}" read_bytes=#{v[:r]},write_bytes=#{v[:w]} #{time})