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

replaced trace comperator

parent 2a2f7843
No related branches found
No related tags found
No related merge requests found
......@@ -76,13 +76,13 @@ class TraceReconstructionBuffer {
}
public final Trace toTrace(final boolean valid) {
final Stack<AbstractEventRecord> stack = new Stack<AbstractEventRecord>();
final Stack<AbstractBeforeEventRecord> stack = new Stack<AbstractBeforeEventRecord>();
for (final AbstractEventRecord event : events) {
if (event instanceof AbstractBeforeEventRecord) {
stack.push(event);
stack.push((AbstractBeforeEventRecord) event);
} else if ((event instanceof AbstractAfterEventRecord)
|| (event instanceof AbstractAfterFailedEventRecord)) {
final AbstractEventRecord beforeEvent = stack.pop();
final AbstractBeforeEventRecord beforeEvent = stack.pop();
final long time = event.getLoggingTimestamp() - beforeEvent.getLoggingTimestamp();
beforeEvent.getRuntime().set(time);
......
......@@ -32,7 +32,11 @@ class TracePatternSummarizationBuffer {
for (int i = 0; i < aggregatedRecords.size(); i++) {
final AbstractEventRecord event = aggregatedRecords.get(i);
if (event instanceof AbstractBeforeEventRecord) {
aggregatedRecords.get(i).getRuntime().merge(records.get(i).getRuntime());
final AbstractBeforeEventRecord abstractBeforeEventRecord = (AbstractBeforeEventRecord) event;
final AbstractBeforeEventRecord abstractBeforeEventRecord2 = (AbstractBeforeEventRecord) records
.get(i);
abstractBeforeEventRecord.getRuntime().merge(
abstractBeforeEventRecord2.getRuntime());
}
}
}
......
......@@ -303,8 +303,7 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
final String cause = stringRegistry.getStringFromId(causeId);
putInRingBuffer(new AfterFailedOperationEventRecord(timestamp, traceId, orderIndex,
objectId, operation, cause, hostApplicationMetadata,
new RuntimeStatisticInformation()));
objectId, operation, cause, hostApplicationMetadata));
} catch (final IdNotAvailableException e) {
putInWaitingMessages(buffer,
AfterFailedOperationEventRecord.COMPRESSED_BYTE_LENGTH_WITH_CLAZZ_ID);
......@@ -322,7 +321,7 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
final String operation = stringRegistry.getStringFromId(operationId);
putInRingBuffer(new AfterOperationEventRecord(timestamp, traceId, orderIndex, objectId,
operation, hostApplicationMetadata, new RuntimeStatisticInformation()));
operation, hostApplicationMetadata));
} catch (final IdNotAvailableException e) {
putInWaitingMessages(buffer,
AfterOperationEventRecord.COMPRESSED_BYTE_LENGTH_WITH_CLAZZ_ID);
......@@ -370,8 +369,7 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
final String cause = stringRegistry.getStringFromId(causeId);
putInRingBuffer(new AfterFailedConstructorEventRecord(timestamp, traceId, orderIndex,
objectId, operation, cause, hostApplicationMetadata,
new RuntimeStatisticInformation()));
objectId, operation, cause, hostApplicationMetadata));
} catch (final IdNotAvailableException e) {
putInWaitingMessages(buffer,
AfterFailedConstructorEventRecord.COMPRESSED_BYTE_LENGTH_WITH_CLAZZ_ID);
......@@ -389,7 +387,7 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
final String operation = stringRegistry.getStringFromId(operationId);
putInRingBuffer(new AfterConstructorEventRecord(timestamp, traceId, orderIndex,
objectId, operation, hostApplicationMetadata, new RuntimeStatisticInformation()));
objectId, operation, hostApplicationMetadata));
} catch (final IdNotAvailableException e) {
putInWaitingMessages(buffer,
AfterConstructorEventRecord.COMPRESSED_BYTE_LENGTH_WITH_CLAZZ_ID);
......@@ -426,8 +424,7 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
final String cause = stringRegistry.getStringFromId(causeId);
putInRingBuffer(new AfterFailedStaticOperationEventRecord(timestamp, traceId,
orderIndex, operation, cause, hostApplicationMetadata,
new RuntimeStatisticInformation()));
orderIndex, operation, cause, hostApplicationMetadata));
} catch (final IdNotAvailableException e) {
putInWaitingMessages(buffer,
AfterFailedStaticOperationEventRecord.COMPRESSED_BYTE_LENGTH_WITH_CLAZZ_ID);
......@@ -444,7 +441,7 @@ public class TCPReaderOneClient extends Thread implements IPeriodicTimeSignalRec
final String operation = stringRegistry.getStringFromId(operationId);
putInRingBuffer(new AfterStaticOperationEventRecord(timestamp, traceId, orderIndex,
operation, hostApplicationMetadata, new RuntimeStatisticInformation()));
operation, hostApplicationMetadata));
} catch (final IdNotAvailableException e) {
putInWaitingMessages(buffer,
AfterStaticOperationEventRecord.COMPRESSED_BYTE_LENGTH_WITH_CLAZZ_ID);
......
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