use of org.iobserve.stages.data.trace.EventBasedTrace in project iobserve-analysis by research-iobserve.
the class TraceReconstructor method reconstructTrace.
private Long reconstructTrace(final IFlowRecord record) {
Long traceId = null;
if (record instanceof TraceMetadata) {
traceId = ((TraceMetadata) record).getTraceId();
final EventBasedTrace eventTrace = this.traceId2trace.getOrCreate(traceId);
eventTrace.setTrace((TraceMetadata) record);
} else if (record instanceof AbstractTraceEvent) {
traceId = ((AbstractTraceEvent) record).getTraceId();
final EventBasedTrace eventTrace = this.traceId2trace.getOrCreate(traceId);
eventTrace.insertEvent((AbstractTraceEvent) record);
}
return traceId;
}
use of org.iobserve.stages.data.trace.EventBasedTrace in project iobserve-analysis by research-iobserve.
the class AnalysisConfiguration method traceProcessing.
/**
* Create trace related filter chains.
*
* @param configuration
* filter configurations
* @throws ConfigurationException
* when configuration fails
*/
private void traceProcessing(final kieker.common.configuration.Configuration configuration) throws ConfigurationException {
if (configuration.getBooleanProperty(ConfigurationKeys.TRACES, false)) {
final TraceReconstructionCompositeStage traceReconstructionStage = new TraceReconstructionCompositeStage(configuration);
OutputPort<EventBasedTrace> behaviorClusteringEventBasedTracePort = traceReconstructionStage.getTraceValidOutputPort();
OutputPort<EventBasedTrace> dataFlowEventBasedTracePort = traceReconstructionStage.getTraceValidOutputPort();
/**
* Connect ports.
*/
final IEventMatcher<IFlowRecord> flowRecordMatcher = new ImplementsEventMatcher<>(IFlowRecord.class, null);
this.eventDispatcher.registerOutput(flowRecordMatcher);
this.connectPorts(flowRecordMatcher.getOutputPort(), traceReconstructionStage.getInputPort());
/**
* Include distributor to support tow simultaneous sinks.
*/
if (configuration.getBooleanProperty(ConfigurationKeys.DATA_FLOW, false) && !configuration.getStringProperty(ConfigurationKeys.BEHAVIOR_CLUSTERING).isEmpty()) {
final IDistributorStrategy strategy = new CopyByReferenceStrategy();
final Distributor<EventBasedTrace> distributor = new Distributor<>(strategy);
this.connectPorts(traceReconstructionStage.getTraceValidOutputPort(), distributor.getInputPort());
behaviorClusteringEventBasedTracePort = distributor.getNewOutputPort();
dataFlowEventBasedTracePort = distributor.getNewOutputPort();
}
/**
* Initialize depending features.
*/
this.behaviorClustering(configuration, behaviorClusteringEventBasedTracePort);
this.dataflow(configuration, dataFlowEventBasedTracePort);
}
}
Aggregations