From: Siraaj Khandkar Date: Fri, 24 Aug 2018 00:41:58 +0000 (-0400) Subject: Do not process collect data we do not use X-Git-Url: https://git.xandkar.net/?p=khatus.git;a=commitdiff_plain;h=0c45b7a3326f8359eedcf265f40f9a160df82f97 Do not process collect data we do not use at least for now, since khatus_bar is now using a noticeable amount of CPU time (~2-3%, up from ~0-0.7%) Definitely need to be more-discriminate about who gets what data, instead of forcing everyone to filter --- diff --git a/bin/khatus_parse_ps b/bin/khatus_parse_ps index 3b8417e..a0f41c5 100755 --- a/bin/khatus_parse_ps +++ b/bin/khatus_parse_ps @@ -8,15 +8,8 @@ BEGIN { { pid = $1 state = $2 - rss = $3 - command_i = index($0, $4) - command = substr($0, command_i, length($0) - (command_i - 1)) - Pids[pid] = 1 Total_Per_State[state]++ - print("state" Kfs pid, state) - print("rss" Kfs pid, rss) - print("command" Kfs pid, command) } END { diff --git a/bin/khatus_sensor_procs b/bin/khatus_sensor_procs index 7083d81..5a3c631 100755 --- a/bin/khatus_sensor_procs +++ b/bin/khatus_sensor_procs @@ -4,4 +4,4 @@ set -e dir_bin="$1" -ps -eo pid,state,rss,command ww --no-headers | "$dir_bin"/khatus_parse_ps +ps -eo pid,state ww --no-headers | "$dir_bin"/khatus_parse_ps