Kieker 1.2

kieker.monitoring.writer.database
Class SyncDbWriter

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

public final class SyncDbWriter
extends Object
implements IMonitoringLogWriter

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 History: 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

Constructor Summary
SyncDbWriter()
           
SyncDbWriter(String dbDriverClassname, String dbConnectionAddress, String dbTableName, boolean setInitialExperimentIdBasedOnLastId)
           
 
Method Summary
 String getInfoString()
          Returns a human-readable information string about the writer's configuration and state.
 Vector<AbstractWorkerThread> getWorkers()
          Returns a vector of workers, or null if none.
 boolean init(String initString)
          Initialize instance from passed initialization string which is typically a list of separated parameter/values pairs.
 boolean newMonitoringRecord(IMonitoringRecord monitoringRecord)
          This method is used to store monitoring data into the database or file system.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncDbWriter

public SyncDbWriter()

SyncDbWriter

public SyncDbWriter(String dbDriverClassname,
                    String dbConnectionAddress,
                    String dbTableName,
                    boolean setInitialExperimentIdBasedOnLastId)
Method Detail

init

public boolean init(String initString)
Description copied from interface: IMonitoringLogWriter
Initialize instance from passed initialization string which is typically a list of separated parameter/values pairs. The implementing class AbstractMonitoringLogWriter includes convenient methods to extract configuration values from an initString.

Specified by:
init in interface IMonitoringLogWriter
Parameters:
initString - the initialization string
Returns:
true iff the initialiation was successful

newMonitoringRecord

public boolean newMonitoringRecord(IMonitoringRecord monitoringRecord)
This method is used to store monitoring data into the database or file system. The storage mode is configured in the file dbconnector.properties.

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

getWorkers

public Vector<AbstractWorkerThread> getWorkers()
Description copied from interface: IMonitoringLogWriter
Returns a vector of workers, or null if none.

Specified by:
getWorkers in interface IMonitoringLogWriter

getInfoString

public String getInfoString()
Description copied from interface: IMonitoringLogWriter
Returns a human-readable information string about the writer's configuration and state.

Specified by:
getInfoString in interface IMonitoringLogWriter
Returns:
the information string.

Kieker 1.2

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