|
From: <do...@hy...> - 2007-03-25 21:36:57
|
Author: dougm Date: 2007-03-25 13:36:53 -0800 (Sun, 25 Mar 2007) New Revision: 3896 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3896 Modified: trunk/plugins/system/src/org/hyperic/hq/plugin/system/TopData.java Log: if no process.query is given, limit ps to first 20 pids Modified: trunk/plugins/system/src/org/hyperic/hq/plugin/system/TopData.java =================================================================== --- trunk/plugins/system/src/org/hyperic/hq/plugin/system/TopData.java 2007-03-25 18:46:40 UTC (rev 3895) +++ trunk/plugins/system/src/org/hyperic/hq/plugin/system/TopData.java 2007-03-25 21:36:53 UTC (rev 3896) @@ -63,14 +63,17 @@ private void ps(Sigar sigar, String filter) throws SigarException { _processes = new ArrayList(); long[] pids; + int max; if (filter == null) { pids = sigar.getProcList(); + max = 20; //XXX make configurable } else { pids = ProcessFinder.find(sigar, filter); + max = pids.length; } - for (int i=0; i<pids.length; i++) { + for (int i=0; i<max; i++) { long pid = pids[i]; try { _processes.add(ProcessData.gather(sigar, pid)); |