Search in sources :

Example 6 with IMonitoringRecord

use of kieker.common.record.IMonitoringRecord in project iobserve-analysis by research-iobserve.

the class DatFileToRecordStage method createRecord.

private void createRecord(final ClassNameRegistry classNameRegistry) throws MappingException, MonitoringRecordException, UnknownRecordTypeException {
    this.charBuffer.flip();
    final char lead = this.charBuffer.get();
    if (lead == '$') {
        final TextValueDeserializer deserializer = TextValueDeserializer.create(this.charBuffer);
        final int id = deserializer.getInt();
        final String classname = classNameRegistry.get(id);
        if (classname == null) {
            throw new MappingException("Missing classname mapping for record type id " + "'" + id + "'");
        }
        final long loggingTimestamp = deserializer.getLong();
        final IRecordFactory<? extends IMonitoringRecord> recordFactory = this.recordFactories.get(classname);
        final IMonitoringRecord event = recordFactory.create(deserializer);
        event.setLoggingTimestamp(loggingTimestamp);
        this.outputPort.send(event);
        this.charBuffer.clear();
    }
}
Also used : IMonitoringRecord(kieker.common.record.IMonitoringRecord) TextValueDeserializer(kieker.common.record.io.TextValueDeserializer) MappingException(teetime.stage.util.MappingException)

Example 7 with IMonitoringRecord

use of kieker.common.record.IMonitoringRecord in project iobserve-analysis by research-iobserve.

the class TestSend method main.

/**
 * Execute send test.
 *
 * @param args
 *            arguments are ignored.
 */
public static void main(final String[] args) {
    TestSend.LOGGER.debug("Sender");
    final Configuration configuration = ConfigurationFactory.createDefaultConfiguration();
    configuration.setProperty(ConfigurationKeys.CONTROLLER_NAME, "Kieker-Test");
    configuration.setProperty(ConfigurationKeys.WRITER_CLASSNAME, TestSend.WRITER_NAME);
    configuration.setProperty(SingleSocketTcpWriter.CONFIG_HOSTNAME, "localhost");
    configuration.setProperty(SingleSocketTcpWriter.CONFIG_PORT, "9876");
    configuration.setProperty(SingleSocketTcpWriter.CONFIG_BUFFERSIZE, "1024");
    configuration.setProperty(SingleSocketTcpWriter.CONFIG_FLUSH, "true");
    // add ignored values
    configuration.setProperty(ConfigurationKeys.PREFIX + "test", "true");
    configuration.setProperty(TestSend.WRITER_NAME + ".test", "true");
    TestSend.LOGGER.debug("Configuration complete");
    final IMonitoringController ctrl = MonitoringController.createInstance(configuration);
    TestSend.LOGGER.debug("Controller active");
    TestSend.LOGGER.debug("Send first record");
    IMonitoringRecord record = new TraceMetadata(1, 2, "demo", "hostname", 0, 0);
    ctrl.newMonitoringRecord(record);
    TestSend.LOGGER.debug("Send second record");
    record = new BeforeOperationEvent(0, 1, 0, "Send", "main");
    ctrl.newMonitoringRecord(record);
    TestSend.LOGGER.debug("Done");
}
Also used : IMonitoringController(kieker.monitoring.core.controller.IMonitoringController) Configuration(kieker.common.configuration.Configuration) IMonitoringRecord(kieker.common.record.IMonitoringRecord) TraceMetadata(kieker.common.record.flow.trace.TraceMetadata) BeforeOperationEvent(kieker.common.record.flow.trace.operation.BeforeOperationEvent)

Aggregations

IMonitoringRecord (kieker.common.record.IMonitoringRecord)7 IOException (java.io.IOException)1 FilterConfig (javax.servlet.FilterConfig)1 ServletContext (javax.servlet.ServletContext)1 ServletException (javax.servlet.ServletException)1 ServletResponse (javax.servlet.ServletResponse)1 HttpSession (javax.servlet.http.HttpSession)1 Configuration (kieker.common.configuration.Configuration)1 RecordInstantiationException (kieker.common.exception.RecordInstantiationException)1 IRecordReceivedListener (kieker.common.record.IRecordReceivedListener)1 ITraceRecord (kieker.common.record.flow.ITraceRecord)1 TraceMetadata (kieker.common.record.flow.trace.TraceMetadata)1 BeforeOperationEvent (kieker.common.record.flow.trace.operation.BeforeOperationEvent)1 TextValueDeserializer (kieker.common.record.io.TextValueDeserializer)1 SingleSocketRecordReader (kieker.common.record.tcp.SingleSocketRecordReader)1 IMonitoringController (kieker.monitoring.core.controller.IMonitoringController)1 EntryLevelBeforeOperationEvent (org.iobserve.common.record.EntryLevelBeforeOperationEvent)1 SessionEndEvent (org.iobserve.common.record.SessionEndEvent)1 ProbeControlFilter (org.iobserve.stages.tcp.ProbeControlFilter)1 Before (org.junit.Before)1