From ad8228ff8fba0186ed2f6ad3ea24c9ea2aa6ef45 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Fri, 5 Nov 2021 18:49:03 +0100 Subject: [PATCH] wip --- procio.cr | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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})