@InputPort(name = INPUT_PORT_NAME_COMBINED, description = "Receives records to be selected by timestamps, based on type-specific selectors", eventTypes = { IMonitoringRecord.class }) public void inputCombined(final IMonitoringRecord record) { if (record instanceof OperationExecutionRecord) { this.inputOperationExecutionRecord((OperationExecutionRecord) record); } else if (record instanceof IEventRecord) { this.inputTraceEvent((IEventRecord) record); } else { this.inputIMonitoringRecord(record); } }
/** * This method represents an input port for both operation execution and flow records. * * @param record * The next record. */ @InputPort(name = INPUT_PORT_NAME_COMBINED, description = "Receives execution and trace events to be selected by trace ID", eventTypes = { ITraceRecord.class, TraceMetadata.class, OperationExecutionRecord.class }) public void inputCombined(final IMonitoringRecord record) { if (record instanceof OperationExecutionRecord) { this.inputOperationExecutionRecord((OperationExecutionRecord) record); } else if ((record instanceof ITraceRecord) || (record instanceof TraceMetadata)) { this.inputTraceEvent((IFlowRecord) record); } // else discard it, we should never have gotten it anyhow }
/** * This method represents the input port receiving trace events to be selected by a specific timestamp selector (based on tin and tout). * * @param execution * The new incoming execution object. */ @InputPort(name = INPUT_PORT_NAME_EXECUTION, description = "Receives trace events to be selected by a specific timestamp selector (based on tin and tout)", eventTypes = { OperationExecutionRecord.class }) public final void inputOperationExecutionRecord(final OperationExecutionRecord execution) { if (this.inRange(execution.getTin()) && this.inRange(execution.getTout())) { super.deliver(OUTPUT_PORT_NAME_WITHIN_PERIOD, execution); } else { super.deliver(OUTPUT_PORT_NAME_OUTSIDE_PERIOD, execution); } } }
final TypeFilter typeFilter = new TypeFilter(confTypeFilter, analysisController); final TimestampFilter timestampFilter = new TimestampFilter(confTimestampFilter, analysisController); final TraceIdFilter traceIdFilter = new TraceIdFilter(confTraceIdFilter, analysisController);
/** * Creates a {@link TimestampFilter} with the given properties * using the constructor {@link TimestampFilter#TimestampFilter(kieker.common.configuration.Configuration, java.util.Map)}. * * @param ignoreExecutionsBeforeTimestamp * @param ignoreExecutionsAfterTimestamp * @return * @throws AnalysisConfigurationException * If the internally assembled analysis configuration is somehow invalid. * @throws IllegalStateException * If the internal analysis is in an invalid state. */ private void createTimestampFilter(final long ignoreExecutionsBeforeTimestamp, final long ignoreExecutionsAfterTimestamp) throws IllegalStateException, AnalysisConfigurationException { final Configuration cfg = new Configuration(); cfg.setProperty(TimestampFilter.CONFIG_PROPERTY_NAME_IGNORE_BEFORE_TIMESTAMP, Long.toString(ignoreExecutionsBeforeTimestamp)); cfg.setProperty(TimestampFilter.CONFIG_PROPERTY_NAME_IGNORE_AFTER_TIMESTAMP, Long.toString(ignoreExecutionsAfterTimestamp)); final TimestampFilter filter = new TimestampFilter(cfg, this.controller); this.controller.connect(this.reader, ListReader.OUTPUT_PORT_NAME, filter, TimestampFilter.INPUT_PORT_NAME_FLOW); this.controller.connect(filter, TimestampFilter.OUTPUT_PORT_NAME_WITHIN_PERIOD, this.sinkPlugin, ListCollectionFilter.INPUT_PORT_NAME); }
/** * * @param timestampFilter * @return * @throws IllegalStateException * @throws AnalysisConfigurationException */ private TraceIdFilter createTraceIdFilter(final TimestampFilter timestampFilter) throws IllegalStateException, AnalysisConfigurationException { // Create the trace ID filter and connect to the timestamp filter's output port final Configuration configTraceIdFilterFlow = new Configuration(); if (this.settings.getSelectedTraces().isEmpty()) { configTraceIdFilterFlow.setProperty(TraceIdFilter.CONFIG_PROPERTY_NAME_SELECT_ALL_TRACES, Boolean.TRUE.toString()); } else { configTraceIdFilterFlow.setProperty(TraceIdFilter.CONFIG_PROPERTY_NAME_SELECT_ALL_TRACES, Boolean.FALSE.toString()); configTraceIdFilterFlow.setProperty(TraceIdFilter.CONFIG_PROPERTY_NAME_SELECTED_TRACES, Configuration .toProperty(this.settings.getSelectedTraces().toArray(new Long[this.settings.getSelectedTraces().size()]))); } final TraceIdFilter traceIdFilter = new TraceIdFilter(configTraceIdFilterFlow, this.analysisController); this.analysisController.connect(timestampFilter, TimestampFilter.OUTPUT_PORT_NAME_WITHIN_PERIOD, traceIdFilter, TraceIdFilter.INPUT_PORT_NAME_COMBINED); return traceIdFilter; }
/** * This method represents an input port for operation execution records. * * @param record * The next record. */ @InputPort(name = INPUT_PORT_NAME_EXECUTION, description = "Receives execution events to be selected by trace ID", eventTypes = { OperationExecutionRecord.class }) public void inputOperationExecutionRecord(final OperationExecutionRecord record) { if (this.acceptId(record.getTraceId())) { super.deliver(OUTPUT_PORT_NAME_MATCH, record); } else { super.deliver(OUTPUT_PORT_NAME_MISMATCH, record); } } }
final TypeFilter typeFilter = new TypeFilter(typeFilterConfiguration, controller); final ListCollectionFilter<Object> sinkPluginValidElements = new ListCollectionFilter<Object>(new Configuration(), controller); final ListCollectionFilter<Object> sinkPluginInvalidElements = new ListCollectionFilter<Object>(new Configuration(), controller);
@InputPort(name = INPUT_PORT_NAME_COMBINED, description = "Receives records to be selected by timestamps, based on type-specific selectors", eventTypes = { IMonitoringRecord.class }) public void inputCombined(final IMonitoringRecord record) { if (record instanceof OperationExecutionRecord) { this.inputOperationExecutionRecord((OperationExecutionRecord) record); } else if (record instanceof IEventRecord) { this.inputTraceEvent((IEventRecord) record); } else { this.inputIMonitoringRecord(record); } }
private TimestampFilter createTimestampFilter(final ThreadEvent2TraceEventFilter sourceStage) throws IllegalStateException, AnalysisConfigurationException { // Create the timestamp filter and connect to the reader's output port final Configuration configTimestampFilter = new Configuration(); configTimestampFilter.setProperty(TimestampFilter.CONFIG_PROPERTY_NAME_IGNORE_BEFORE_TIMESTAMP, this.longToString(this.settings.getIgnoreExecutionsBeforeDate())); configTimestampFilter.setProperty(TimestampFilter.CONFIG_PROPERTY_NAME_IGNORE_AFTER_TIMESTAMP, this.longToString(this.settings.getIgnoreExecutionsAfterDate())); final TimestampFilter timestampFilter = new TimestampFilter(configTimestampFilter, this.analysisController); this.analysisController.connect(sourceStage, ThreadEvent2TraceEventFilter.OUTPUT_PORT_NAME_DEFAULT, timestampFilter, TimestampFilter.INPUT_PORT_NAME_EXECUTION); this.analysisController.connect(sourceStage, ThreadEvent2TraceEventFilter.OUTPUT_PORT_NAME_DEFAULT, timestampFilter, TimestampFilter.INPUT_PORT_NAME_FLOW); return timestampFilter; }
/** * This method represents an input port for both operation execution and flow records. * * @param record * The next record. */ @InputPort(name = INPUT_PORT_NAME_COMBINED, description = "Receives execution and trace events to be selected by trace ID", eventTypes = { ITraceRecord.class, TraceMetadata.class, OperationExecutionRecord.class }) public void inputCombined(final IMonitoringRecord record) { if (record instanceof OperationExecutionRecord) { this.inputOperationExecutionRecord((OperationExecutionRecord) record); } else if ((record instanceof ITraceRecord) || (record instanceof TraceMetadata)) { this.inputTraceEvent((IFlowRecord) record); } // else discard it, we should never have gotten it anyhow }
final Configuration filterConfig = new Configuration(); final TraceIdFilter filter = new TraceIdFilter(filterConfig, controller); final ListCollectionFilter<AbstractTraceEvent> sinkPlugin = new ListCollectionFilter<AbstractTraceEvent>(new Configuration(), controller);
/** * This method represents the input port receiving trace events to be selected * by a specific timestamp selector (based on tin and tout). * * @param execution * The new incoming execution object. */ @InputPort(name = INPUT_PORT_NAME_EXECUTION, description = "Receives trace events to be selected by a specific timestamp selector (based on tin and tout)", eventTypes = { OperationExecutionRecord.class }) public final void inputOperationExecutionRecord(final OperationExecutionRecord execution) { if (this.inRange(execution.getTin()) && this.inRange(execution.getTout())) { super.deliver(OUTPUT_PORT_NAME_WITHIN_PERIOD, execution); } else { super.deliver(OUTPUT_PORT_NAME_OUTSIDE_PERIOD, execution); } } }
/** * This method represents an input port for operation execution records. * * @param record * The next record. */ @InputPort(name = INPUT_PORT_NAME_EXECUTION, description = "Receives execution events to be selected by trace ID", eventTypes = { OperationExecutionRecord.class }) public void inputOperationExecutionRecord(final OperationExecutionRecord record) { if (this.acceptId(record.getTraceId())) { super.deliver(OUTPUT_PORT_NAME_MATCH, record); } else { super.deliver(OUTPUT_PORT_NAME_MISMATCH, record); } } }
@InputPort(name = INPUT_PORT_NAME_ANY_RECORD, description = "Receives records to be selected by their logging timestamps", eventTypes = { IMonitoringRecord.class }) public final void inputIMonitoringRecord(final IMonitoringRecord record) { if (this.inRange(record.getLoggingTimestamp())) { super.deliver(OUTPUT_PORT_NAME_WITHIN_PERIOD, record); } else { super.deliver(OUTPUT_PORT_NAME_OUTSIDE_PERIOD, record); } }
/** * This method represents an input port for flow records. * * @param record * The next record. */ @InputPort(name = INPUT_PORT_NAME_FLOW, description = "Receives trace events to be selected by trace ID", eventTypes = { ITraceRecord.class, TraceMetadata.class }) public void inputTraceEvent(final IFlowRecord record) { final long traceId; if (record instanceof TraceMetadata) { traceId = ((TraceMetadata) record).getTraceId(); } else if (record instanceof AbstractTraceEvent) { traceId = ((ITraceRecord) record).getTraceId(); } else { // should not happen given the accepted type return; } if (this.acceptId(traceId)) { super.deliver(OUTPUT_PORT_NAME_MATCH, record); } else { super.deliver(OUTPUT_PORT_NAME_MISMATCH, record); } }
@InputPort(name = INPUT_PORT_NAME_ANY_RECORD, description = "Receives records to be selected by their logging timestamps", eventTypes = { IMonitoringRecord.class }) public final void inputIMonitoringRecord(final IMonitoringRecord record) { if (this.inRange(record.getLoggingTimestamp())) { super.deliver(OUTPUT_PORT_NAME_WITHIN_PERIOD, record); } else { super.deliver(OUTPUT_PORT_NAME_OUTSIDE_PERIOD, record); } }
/** * This method represents an input port for flow records. * * @param record * The next record. */ @InputPort(name = INPUT_PORT_NAME_FLOW, description = "Receives trace events to be selected by trace ID", eventTypes = { ITraceRecord.class, TraceMetadata.class }) public void inputTraceEvent(final IFlowRecord record) { final long traceId; if (record instanceof TraceMetadata) { traceId = ((TraceMetadata) record).getTraceId(); } else if (record instanceof AbstractTraceEvent) { traceId = ((ITraceRecord) record).getTraceId(); } else { // should not happen given the accepted type return; } if (this.acceptId(traceId)) { super.deliver(OUTPUT_PORT_NAME_MATCH, record); } else { super.deliver(OUTPUT_PORT_NAME_MISMATCH, record); } }
/** * This method represents the input port receiving trace events to be selected by a specific timestamp selector. * * @param record * The new incoming record. */ @InputPort(name = INPUT_PORT_NAME_FLOW, description = "Receives trace events to be selected by a specific timestamp selector", eventTypes = { IEventRecord.class, TraceMetadata.class }) public final void inputTraceEvent(final IFlowRecord record) { final long timestamp; if (record instanceof TraceMetadata) { timestamp = ((TraceMetadata) record).getLoggingTimestamp(); } else if (record instanceof IEventRecord) { timestamp = ((IEventRecord) record).getTimestamp(); } else { // should not happen given the accepted type return; } if (this.inRange(timestamp)) { super.deliver(OUTPUT_PORT_NAME_WITHIN_PERIOD, record); } else { super.deliver(OUTPUT_PORT_NAME_OUTSIDE_PERIOD, record); } }
/** * This method represents the input port receiving trace events to be selected * by a specific timestamp selector. * * @param record * The new incoming record. */ @InputPort(name = INPUT_PORT_NAME_FLOW, description = "Receives trace events to be selected by a specific timestamp selector", eventTypes = { IEventRecord.class, TraceMetadata.class }) public final void inputTraceEvent(final IFlowRecord record) { final long timestamp; if (record instanceof TraceMetadata) { timestamp = ((TraceMetadata) record).getLoggingTimestamp(); } else if (record instanceof IEventRecord) { timestamp = ((IEventRecord) record).getTimestamp(); } else { // should not happen given the accepted type return; } if (this.inRange(timestamp)) { super.deliver(OUTPUT_PORT_NAME_WITHIN_PERIOD, record); } else { super.deliver(OUTPUT_PORT_NAME_OUTSIDE_PERIOD, record); } }