Просмотр исходного кода

Change Process Monitor command line to reflect real CPU usage from TOP instead of average from PS

®omano 9 лет назад
Родитель
Сommit
68abaf3358
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      ogp_agent.pl

+ 2 - 2
ogp_agent.pl

@@ -3833,7 +3833,7 @@ sub shell_action
 	elsif($action eq 'get_tasklist')
 	{
 		my %taskList;
-		$taskList{'task'} = encode_base64(`ps -Ao user,pid,pcpu,pmem,comm,args --sort=-pcpu | head -n 30`);
+		$taskList{'task'} = encode_base64(`top -b -c -o +%CPU -w512 -n1|grep "COMMAND" -A 30`);
 		return {%taskList};
 	}
 	elsif($action eq 'get_timestamp')
@@ -3898,4 +3898,4 @@ sub remote_query
 		return encode_base64($response, "");
 	}
 	return -1;
-}
+}