Skip to content
Snippets Groups Projects
Commit 84f6d461 authored by Jan Waller's avatar Jan Waller
Browse files

bugifx for meta-monitoring

parent 0d747b07
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,6 @@
<classpathentry kind="src" path="frameworks/Kieker/src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="lib" path="lib/commons-cli-1.2.jar"/>
<classpathentry kind="lib" path="frameworks/Kieker/lib/kieker-1.10-SNAPSHOT_aspectj.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Kieker"/>
<classpathentry kind="output" path="build-eclipse"/>
</classpath>
......@@ -7,8 +7,8 @@ RESULTSDIR="${BASEDIR}results/"
THREADS=1 ## 1
RECURSIONDEPTH=10 ## 10
TOTALCALLS=1000 ## 2000000
METHODTIME=500000 ## 500000
TOTALCALLS=20000 ## 20000
METHODTIME=0 ## 0
#MOREPARAMS="--quickstart"
MOREPARAMS="${MOREPARAMS} -r kieker.Logger -a mooBench.monitoredApplication.MonitoredClassManualInstrumentation"
......
......@@ -49,7 +49,7 @@ public final class MonitoredClassManualInstrumentation implements MonitoredClass
}
public final long monitoredMethod(final long methodTime, final int recDepth) {
final TraceMetadata trace = MonitoredClassManualInstrumentation.triggerBefore();
final boolean newTrace = MonitoredClassManualInstrumentation.triggerBefore();
long retval;
if (recDepth > 1) {
retval = this.monitoredMethod(methodTime, recDepth - 1);
......@@ -61,17 +61,17 @@ public final class MonitoredClassManualInstrumentation implements MonitoredClass
} while (currentTime < exitTime);
retval = currentTime;
}
MonitoredClassManualInstrumentation.triggerAfter(trace);
MonitoredClassManualInstrumentation.triggerAfter(newTrace);
return retval;
}
private final static TraceMetadata triggerBefore() {
private final static boolean triggerBefore() {
if (!CTRLINST.isMonitoringEnabled()) {
return null;
return false;
}
final String signature = SIGNATURE;
if (!CTRLINST.isProbeActivated(signature)) {
return null;
return false;
}
TraceMetadata trace = TRACEREGISTRY.getTrace();
final boolean newTrace = trace == null;
......@@ -82,12 +82,16 @@ public final class MonitoredClassManualInstrumentation implements MonitoredClass
final long traceId = trace.getTraceId();
final String clazz = CLAZZ;
CTRLINST.newMonitoringRecord(new BeforeOperationEvent(TIME.getTime(), traceId, trace.getNextOrderId(), signature, clazz));
return trace;
return newTrace;
}
private final static void triggerAfter(final TraceMetadata trace) {
private final static void triggerAfter(final boolean newTrace) {
final TraceMetadata trace = TRACEREGISTRY.getTrace();
final String signature = SIGNATURE;
final String clazz = CLAZZ;
CTRLINST.newMonitoringRecord(new AfterOperationEvent(TIME.getTime(), trace.getTraceId(), trace.getNextOrderId(), signature, clazz));
if (newTrace) { // close the trace
TRACEREGISTRY.unregisterTrace();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment