Search in sources :

Example 1 with EventBasedTrace

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;
}
Also used : EventBasedTrace(org.iobserve.stages.data.trace.EventBasedTrace) TraceMetadata(kieker.common.record.flow.trace.TraceMetadata) AbstractTraceEvent(kieker.common.record.flow.trace.AbstractTraceEvent)

Example 2 with EventBasedTrace

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);
    }
}
Also used : Distributor(teetime.stage.basic.distributor.Distributor) TraceReconstructionCompositeStage(org.iobserve.analysis.traces.TraceReconstructionCompositeStage) EventBasedTrace(org.iobserve.stages.data.trace.EventBasedTrace) IFlowRecord(kieker.common.record.flow.IFlowRecord) IDistributorStrategy(teetime.stage.basic.distributor.strategy.IDistributorStrategy) ImplementsEventMatcher(org.iobserve.stages.general.ImplementsEventMatcher) CopyByReferenceStrategy(teetime.stage.basic.distributor.strategy.CopyByReferenceStrategy)

Aggregations

EventBasedTrace (org.iobserve.stages.data.trace.EventBasedTrace)2 IFlowRecord (kieker.common.record.flow.IFlowRecord)1 AbstractTraceEvent (kieker.common.record.flow.trace.AbstractTraceEvent)1 TraceMetadata (kieker.common.record.flow.trace.TraceMetadata)1 TraceReconstructionCompositeStage (org.iobserve.analysis.traces.TraceReconstructionCompositeStage)1 ImplementsEventMatcher (org.iobserve.stages.general.ImplementsEventMatcher)1 Distributor (teetime.stage.basic.distributor.Distributor)1 CopyByReferenceStrategy (teetime.stage.basic.distributor.strategy.CopyByReferenceStrategy)1 IDistributorStrategy (teetime.stage.basic.distributor.strategy.IDistributorStrategy)1