added a high cpu cycle monitor to PerformanceQueues

pull/1/head
Michael Peter Christen 10 years ago
parent 5082feb103
commit 7817fc50c9

@ -23,6 +23,7 @@
<td>Idle<br />Cycles</td> <td>Idle<br />Cycles</td>
<td>Busy<br />Cycles</td> <td>Busy<br />Cycles</td>
<td>Short Mem<br />Cycles</td> <td>Short Mem<br />Cycles</td>
<td>High CPU<br />Cycles</td>
<td>Sleep Time<br />per Cycle<br />(millis)</td> <td>Sleep Time<br />per Cycle<br />(millis)</td>
<td>Exec Time<br />per Busy-Cycle<br />(millis)</td> <td>Exec Time<br />per Busy-Cycle<br />(millis)</td>
<td>Memory Use<br />per Busy-Cycle<br />(kbytes)</td> <td>Memory Use<br />per Busy-Cycle<br />(kbytes)</td>
@ -46,6 +47,7 @@
<td align="right">#[idlecycles]#</td> <td align="right">#[idlecycles]#</td>
<td align="right">#[busycycles]#</td> <td align="right">#[busycycles]#</td>
<td align="right">#[memscycles]#</td> <td align="right">#[memscycles]#</td>
<td align="right">#[highcpucycles]#</td>
<td align="right">#[sleeppercycle]#</td> <td align="right">#[sleeppercycle]#</td>
<td align="right">#[execpercycle]#</td> <td align="right">#[execpercycle]#</td>
<td align="right">#[memusepercycle]#</td> <td align="right">#[memusepercycle]#</td>

@ -113,7 +113,7 @@ public class PerformanceQueues_p {
int queuesize; int queuesize;
threads = sb.threadNames(); threads = sb.threadNames();
int c = 0; int c = 0;
long idleCycles, busyCycles, memshortageCycles; long idleCycles, busyCycles, memshortageCycles, highCPUCycles;
// set profile? // set profile?
final boolean setProfile = (post != null && post.containsKey("submitdefault")); final boolean setProfile = (post != null && post.containsKey("submitdefault"));
final boolean setDelay = (post != null) && (post.containsKey("submitdelay")); final boolean setDelay = (post != null) && (post.containsKey("submitdelay"));
@ -148,16 +148,18 @@ public class PerformanceQueues_p {
idleCycles = thread.getIdleCycles(); idleCycles = thread.getIdleCycles();
busyCycles = thread.getBusyCycles(); busyCycles = thread.getBusyCycles();
memshortageCycles = thread.getOutOfMemoryCycles(); memshortageCycles = thread.getOutOfMemoryCycles();
highCPUCycles = thread.getHighCPUCycles();
prop.putNum("table_" + c + "_blocktime", blocktime / 1000); prop.putNum("table_" + c + "_blocktime", blocktime / 1000);
prop.putNum("table_" + c + "_blockpercent", 100 * blocktime / blocktime_total); prop.putNum("table_" + c + "_blockpercent", 100 * blocktime / blocktime_total);
prop.putNum("table_" + c + "_sleeptime", sleeptime / 1000); prop.putNum("table_" + c + "_sleeptime", sleeptime / 1000);
prop.putNum("table_" + c + "_sleeppercent", 100 * sleeptime / sleeptime_total); prop.putNum("table_" + c + "_sleeppercent", 100 * sleeptime / sleeptime_total);
prop.putNum("table_" + c + "_exectime", exectime / 1000); prop.putNum("table_" + c + "_exectime", exectime / 1000);
prop.putNum("table_" + c + "_execpercent", 100 * exectime / exectime_total); prop.putNum("table_" + c + "_execpercent", 100 * exectime / exectime_total);
prop.putNum("table_" + c + "_totalcycles", idleCycles + busyCycles + memshortageCycles); prop.putNum("table_" + c + "_totalcycles", idleCycles + busyCycles + memshortageCycles + highCPUCycles);
prop.putNum("table_" + c + "_idlecycles", idleCycles); prop.putNum("table_" + c + "_idlecycles", idleCycles);
prop.putNum("table_" + c + "_busycycles", busyCycles); prop.putNum("table_" + c + "_busycycles", busyCycles);
prop.putNum("table_" + c + "_memscycles", memshortageCycles); prop.putNum("table_" + c + "_memscycles", memshortageCycles);
prop.putNum("table_" + c + "_highcpucycles", highCPUCycles);
prop.putNum("table_" + c + "_sleeppercycle", ((idleCycles + busyCycles) == 0) ? -1 : sleeptime / (idleCycles + busyCycles)); prop.putNum("table_" + c + "_sleeppercycle", ((idleCycles + busyCycles) == 0) ? -1 : sleeptime / (idleCycles + busyCycles));
prop.putNum("table_" + c + "_execpercycle", (busyCycles == 0) ? -1 : exectime / busyCycles); prop.putNum("table_" + c + "_execpercycle", (busyCycles == 0) ? -1 : exectime / busyCycles);
prop.putNum("table_" + c + "_memusepercycle", (busyCycles == 0) ? -1 : memuse / busyCycles / 1024); prop.putNum("table_" + c + "_memusepercycle", (busyCycles == 0) ? -1 : memuse / busyCycles / 1024);

@ -14,6 +14,7 @@
<idlecycles>#[idlecycles]#</idlecycles> <idlecycles>#[idlecycles]#</idlecycles>
<busycycles>#[busycycles]#</busycycles> <busycycles>#[busycycles]#</busycycles>
<memscycles>#[memscycles]#</memscycles> <memscycles>#[memscycles]#</memscycles>
<highcpucycles>#[highcpucycles]#</highcpucycles>
<sleeppercycle>#[sleeppercycle]#</sleeppercycle> <sleeppercycle>#[sleeppercycle]#</sleeppercycle>
<execpercycle>#[execpercycle]#</execpercycle> <execpercycle>#[execpercycle]#</execpercycle>
<memusepercycle>#[memusepercycle]#</memusepercycle> <memusepercycle>#[memusepercycle]#</memusepercycle>

@ -36,7 +36,7 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
private final static ConcurrentLog log = new ConcurrentLog("BusyThread"); private final static ConcurrentLog log = new ConcurrentLog("BusyThread");
private long startup = 0, intermission = 0, idlePause = 0, busyPause = 0; private long startup = 0, intermission = 0, idlePause = 0, busyPause = 0;
private long idletime = 0, memprereq = 0; private long idletime = 0, memprereq = 0;
private long idleCycles = 0, busyCycles = 0, outofmemoryCycles = 0; private long idleCycles = 0, busyCycles = 0, outofmemoryCycles = 0, highCPUCycles = 0;
private double loadprereq = 9; private double loadprereq = 9;
private boolean intermissionObedient = true; private boolean intermissionObedient = true;
private final Object syncObject = new Object(); private final Object syncObject = new Object();
@ -122,6 +122,11 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
// a job execution was omitted because of memory shortage // a job execution was omitted because of memory shortage
return this.outofmemoryCycles; return this.outofmemoryCycles;
} }
@Override
public long getHighCPUCycles() {
return this.highCPUCycles;
}
@Override @Override
public final long getSleepTime() { public final long getSleepTime() {
@ -182,6 +187,7 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
logSystem("Thread '" + this.getName() + "' runs high load cycle. current: " + Memory.load() + " max.: " + loadprereq); logSystem("Thread '" + this.getName() + "' runs high load cycle. current: " + Memory.load() + " max.: " + loadprereq);
timestamp = System.currentTimeMillis(); timestamp = System.currentTimeMillis();
ratz(this.idlePause); ratz(this.idlePause);
highCPUCycles++;
idletime += System.currentTimeMillis() - timestamp; idletime += System.currentTimeMillis() - timestamp;
} else if (MemoryControl.request(memprereq, false)) try { } else if (MemoryControl.request(memprereq, false)) try {
// do job // do job

@ -92,7 +92,13 @@ public interface BusyThread extends WorkflowThread {
* because of memory shortage * because of memory shortage
*/ */
public long getOutOfMemoryCycles(); public long getOutOfMemoryCycles();
/**
* @return the total number of cycles where a job execution was omitted
* because of too high CPU load
*/
public long getHighCPUCycles();
/** /**
* @return the total time that this thread has slept so far * @return the total time that this thread has slept so far
*/ */

Loading…
Cancel
Save