package tools.descartes.teastore.kieker.rabbitmq;

import kieker.analysis.IProjectContext;
import kieker.analysis.plugin.annotation.InputPort;
import kieker.analysis.plugin.filter.AbstractFilterPlugin;
import kieker.common.configuration.Configuration;
import kieker.common.record.IMonitoringRecord;

public class LogConsumer extends AbstractFilterPlugin {

	public static final String INPUT_PORT_NAME = "newMonitoringRecord";

	public LogConsumer(final Configuration configuration, final IProjectContext projectContext) {
		super(configuration, projectContext);
	}
	
	@InputPort(name = LogConsumer.INPUT_PORT_NAME, eventTypes = { IMonitoringRecord.class })
	public void newMonitoringRecord(final Object record) {
		if (record instanceof IMonitoringRecord) {
			IMonitoringRecord monitoringRecord = (IMonitoringRecord)record;
			MemoryLogStorage.storeRecord(monitoringRecord);
		} else {
			throw new IllegalStateException("Unknown monitoring result type");
		}
	}

	@Override
	public Configuration getCurrentConfiguration() {
		return new Configuration();
	}

}

@@ -298,16 +298,74 @@
 Record;%0D
+%0Aimport kieker.common.record.system.CPUUtilizationRecord;%0D
 %0A%0D%0Apubli
@@ -828,16 +828,206 @@
 ord) %7B%0D%0A
+%09%09%09if (record instanceof CPUUtilizationRecord) %7B%0D%0A%09%09%09%09CPUUtilizationRecord cpu = (CPUUtilizationRecord)record;%0D%0A%09%09%09%09System.out.println(cpu.getHostname() + cpu.getTotalUtilization());%0D%0A%09%09%09%7D%0D%0A
 %09%09%09IMoni

debug messages