Kieker 1.3

kieker.monitoring.writer.database
Class SyncDbWriter

java.lang.Object
  extended by kieker.monitoring.writer.AbstractMonitoringWriter
      extended by kieker.monitoring.writer.database.SyncDbWriter
All Implemented Interfaces:
IMonitoringRecordReceiver, IMonitoringWriter

public final class SyncDbWriter
extends AbstractMonitoringWriter

Stores monitoring data into a database. Warning! This class is an academic prototype and not intended for usage in any critical system. The insertMonitoringData methods should be thread-save (also in combination with experimentId changes), so that they may be used by multiple threads at the same time. We have tested this in various applications, in combination with the standard MySQL Connector/J database driver. We experienced that the monitoring it is not a major bottleneck if not too many measurement points are used (e.g., 30/second). However, there is additional performance tuning possible. For instance, by collecting multiple database commands before sending it to the database, or by implementing "statistical profiling", which stores only samples instead of all executions.

Author:
Matthias Rohr, Andre van Hoorn, Jan Waller History: 2011/03/23: Changed constructor 2008/05/29: Changed vmid to vmname (defaults to hostname), which may be changed during runtime 2008/01/04: Refactoring for the first release of Kieker and publication under an open source licence 2007/03/13: Refactoring 2006/12/20: Initial Prototype

Field Summary
static String CONFIG__CONNECTIONSTRING
           
static String CONFIG__DRIVERCLASSNAME
           
static String CONFIG__TABLENAME
           
 
Constructor Summary
SyncDbWriter(Configuration configuration)
           
 
Method Summary
 void init()
          Implementing classes should indicate an initialization error by throwing an Exception.
 boolean newMonitoringRecord(IMonitoringRecord monitoringRecord)
          Called for each new record.
 void terminate()
          Called by the Monitoring Controller to announce a shutdown of monitoring.
 String toString()
           
 
Methods inherited from class kieker.monitoring.writer.AbstractMonitoringWriter
getConfiguration, setController
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIG__DRIVERCLASSNAME

public static final String CONFIG__DRIVERCLASSNAME

CONFIG__CONNECTIONSTRING

public static final String CONFIG__CONNECTIONSTRING

CONFIG__TABLENAME

public static final String CONFIG__TABLENAME
Constructor Detail

SyncDbWriter

public SyncDbWriter(Configuration configuration)
             throws Exception
Throws:
Exception
Method Detail

init

public final void init()
                throws Exception,
                       SQLException
Description copied from class: AbstractMonitoringWriter
Implementing classes should indicate an initialization error by throwing an Exception.

Throws:
Exception
SQLException

newMonitoringRecord

public final boolean newMonitoringRecord(IMonitoringRecord monitoringRecord)
Description copied from interface: IMonitoringRecordReceiver
Called for each new record. Notice, that this method should not throw an exception, but indicate an error by the return value false.

Specified by:
newMonitoringRecord in interface IMonitoringRecordReceiver
Specified by:
newMonitoringRecord in interface IMonitoringWriter
Specified by:
newMonitoringRecord in class AbstractMonitoringWriter
Parameters:
monitoringRecord - the record.
Returns:
true on success; false in case of an error.

terminate

public void terminate()
Description copied from interface: IMonitoringWriter
Called by the Monitoring Controller to announce a shutdown of monitoring. Writers should return as soon as it is safe to terminate Kieker.

Specified by:
terminate in interface IMonitoringWriter
Specified by:
terminate in class AbstractMonitoringWriter

toString

public String toString()
Specified by:
toString in interface IMonitoringWriter
Overrides:
toString in class AbstractMonitoringWriter

Kieker 1.3

Copyright 2011 the Kieker Project, http://kieker.sourceforge.net