Skip to content
Snippets Groups Projects
Commit 4e06d1ac authored by Florian Fittkau's avatar Florian Fittkau
Browse files

minor

parent 225bc219
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ package explorviz.live_trace_processing.filter.reduction;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import explorviz.live_trace_processing.Constants;
......@@ -77,7 +78,7 @@ public class TracesSummarizationFilter extends AbstractFilter implements ITraceR
final AbstractBeforeOperationEventRecord abstractBeforeOperationEventRecord = (AbstractBeforeOperationEventRecord) abstractBeforeEventRecord;
abstractBeforeOperationEventRecord.getRuntimeStatisticInformation()
.makeAccumulator(abstractBeforeOperationEventRecord.getObjectId());
.makeAccumulator(abstractBeforeOperationEventRecord.getObjectId());
} else {
abstractBeforeEventRecord.getRuntimeStatisticInformation().makeAccumulator(0);
......@@ -89,15 +90,21 @@ public class TracesSummarizationFilter extends AbstractFilter implements ITraceR
private void processTimeoutQueue(final long timestamp) {
final long bufferTimeout = timestamp - maxCollectionDuration;
final List<Trace> toRemove = new ArrayList<Trace>();
for (final TracesSummarizationBuffer traceBuffer : trace2buffer.values()) {
if (traceBuffer.getBufferCreatedTimestamp() <= bufferTimeout) {
final Trace aggregatedTrace = traceBuffer.getAggregatedTrace();
for (final Entry<Trace, TracesSummarizationBuffer> traceBufferEntrySet : trace2buffer
.entrySet()) {
if (traceBufferEntrySet.getValue().getBufferCreatedTimestamp() <= bufferTimeout) {
final Trace aggregatedTrace = traceBufferEntrySet.getValue().getAggregatedTrace();
deliver(aggregatedTrace);
toRemove.add(aggregatedTrace);
toRemove.add(traceBufferEntrySet.getKey());
}
}
for (final Trace traceEventRecords : toRemove) {
trace2buffer.remove(traceEventRecords);
for (final Trace trace : toRemove) {
if (trace2buffer.remove(trace) == null) {
System.out.println("no trace found :(");
}
}
}
......
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