From 0c45b7a3326f8359eedcf265f40f9a160df82f97 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Thu, 23 Aug 2018 20:41:58 -0400 Subject: [PATCH] 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 --- bin/khatus_parse_ps | 7 ------- bin/khatus_sensor_procs | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) 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 -- 2.20.1