diff --git a/procio.cr b/procio.cr index 0a90def..ba74b0a 100644 --- a/procio.cr +++ b/procio.cr @@ -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})