use of kieker.monitoring.core.controller.IMonitoringController 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");
}
Aggregations