Kieker 1.3

kieker.monitoring.writer.filesystem
Class SyncFsWriter

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

public final class SyncFsWriter
extends AbstractMonitoringWriter

Simple class to store monitoring data in the file system. Although a buffered writer is used, outliers (delays of 1000 ms) occur from time to time if many monitoring events have to be writen. We believe that outliers result from a flush on the buffer of the writer. A more sophisticated writer to store data in the file system is the AsyncFsWriter. This does not introduce the outliers that result from flushing the writing buffer, since provides an asynchronous insertMonitoringData method. However, the AsyncFsWriter introduces a little more overhead because a writing queue is required and it isn't tested as much as the FileSystenWriter. Additionally, the resource demands (CPU, bus etc.) for writing monitoring data are not anymore occurring during the time of the execution that is monitored, but at some other (unknown) time. The AsyncFsWriter should usually be used instead of this class to avoid the outliers described above. The asyncFsWriter is not(!) faster (but also it shouldn't be much slower) because only one thread is used for writing into a single file. To tune it, it might be an option to write to multiple files, while writing with more than one thread into a single file is not considered a save option.

Author:
Matthias Rohr, Andre van Hoorn, Jan Waller History: 2008/01/04: Refactoring for the first release of Kieker and publication under an open source license 2007/03/13: Refactoring 2006/12/20: Initial Prototype

Field Summary
static String CONFIG__PATH
           
static String CONFIG__TEMP
           
 
Constructor Summary
SyncFsWriter(Configuration configuration)
           
 
Method Summary
 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__PATH

public static final String CONFIG__PATH

CONFIG__TEMP

public static final String CONFIG__TEMP
Constructor Detail

SyncFsWriter

public SyncFsWriter(Configuration configuration)
Method Detail

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 final 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 final 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