From: Patrick G. <sf...@us...> - 2006-02-09 15:35:54
|
Update of /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/examples/dynamicwebserver/monitor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28971 Modified Files: CPUMonitorImpl.java Log Message: corrected split command Index: CPUMonitorImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/examples/dynamicwebserver/monitor/CPUMonitorImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CPUMonitorImpl.java 9 Feb 2006 13:58:25 -0000 1.3 --- CPUMonitorImpl.java 9 Feb 2006 15:35:45 -0000 1.4 *************** *** 60,64 **** String vmstatCmd = cmd + delay + ((char) 10); ! int splitIndex = 15; Vector last10 = new Vector(10); --- 60,64 ---- String vmstatCmd = cmd + delay + ((char) 10); ! int splitIndex = 14; Vector last10 = new Vector(10); *************** *** 219,227 **** try { String s = pOut.readLine(); - if (s != null) { ! s = s.split(" ")[splitIndex]; current = 100 - (Integer.parseInt(s.trim())); totalCPU = totalCPU + current; logger.logOptional(name, --- 219,229 ---- try { String s = pOut.readLine(); if (s != null) { ! String[] a = s.trim().split("\\W+"); ! s = a[splitIndex]; ! current = 100 - (Integer.parseInt(s.trim())); + totalCPU = totalCPU + current; logger.logOptional(name, |