Class FileWriter
java.lang.Object
kieker.monitoring.writer.AbstractMonitoringWriter
kieker.monitoring.writer.filesystem.FileWriter
- All Implemented Interfaces:
kieker.common.registry.IRegistryListener<java.lang.String>
public class FileWriter extends AbstractMonitoringWriter implements kieker.common.registry.IRegistryListener<java.lang.String>
Generic file writer which can be used to write any type of serialization.
Presently, two serialization methods exist.
- Since:
- 1.14
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_BUFFERSIZEThe name of the configuration key for the buffer size.static java.lang.StringCONFIG_CHARSET_NAMEThe name of the configuration for the charset name used to store strings (e.g.static java.lang.StringCONFIG_COMPRESSION_FILTERThe name of the configuration key to select a compression for the record log files.static java.lang.StringCONFIG_FLUSHThe name of the configuration key determining to always flush the output file stream after writing each record.static java.lang.StringCONFIG_LOG_POOL_FILE_HANDLERThe name of the configuration to define the handler of the file pool.static java.lang.StringCONFIG_LOG_STREAM_HANDLERThe name of the configuration to define the handler of the log stream.static java.lang.StringCONFIG_MAP_FILE_HANDLERThe name of the configuration to switch for the map file handler; default TextMapFileHandler.static java.lang.StringCONFIG_MAXENTRIESINFILEThe name of the configuration determining the maximal number of entries in a file.static java.lang.StringCONFIG_MAXLOGFILESThe name of the configuration determining the maximal number of log files.static java.lang.StringCONFIG_MAXLOGSIZEThe name of the configuration determining the maximal size of the files in MiB.static java.lang.StringCONFIG_PATHThe name of the configuration for the custom storage path if the writer is advised not to store in the temporary directory.static java.lang.StringPREFIX -
Constructor Summary
Constructors Constructor Description FileWriter(kieker.common.configuration.Configuration configuration)Create a generic file writer. -
Method Summary
Modifier and Type Method Description voidonNewRegistryEntry(java.lang.String value, int id)voidonStarting()This event fires when Kieker has been initialized and is ready to monitor.voidonTerminating()This event fires when Kieker has been notified to terminate.java.lang.StringtoString()Returns a textual representation of the writer's configuration.voidwriteMonitoringRecord(kieker.common.record.IMonitoringRecord record)This event fires when Kieker has received a new record.
-
Field Details
-
PREFIX
public static final java.lang.String PREFIX -
CONFIG_PATH
public static final java.lang.String CONFIG_PATHThe name of the configuration for the custom storage path if the writer is advised not to store in the temporary directory. -
CONFIG_CHARSET_NAME
public static final java.lang.String CONFIG_CHARSET_NAMEThe name of the configuration for the charset name used to store strings (e.g. "UTF-8"). -
CONFIG_MAXENTRIESINFILE
public static final java.lang.String CONFIG_MAXENTRIESINFILEThe name of the configuration determining the maximal number of entries in a file. -
CONFIG_MAXLOGSIZE
public static final java.lang.String CONFIG_MAXLOGSIZEThe name of the configuration determining the maximal size of the files in MiB. -
CONFIG_MAXLOGFILES
public static final java.lang.String CONFIG_MAXLOGFILESThe name of the configuration determining the maximal number of log files. -
CONFIG_MAP_FILE_HANDLER
public static final java.lang.String CONFIG_MAP_FILE_HANDLERThe name of the configuration to switch for the map file handler; default TextMapFileHandler. -
CONFIG_LOG_POOL_FILE_HANDLER
public static final java.lang.String CONFIG_LOG_POOL_FILE_HANDLERThe name of the configuration to define the handler of the file pool. -
CONFIG_LOG_STREAM_HANDLER
public static final java.lang.String CONFIG_LOG_STREAM_HANDLERThe name of the configuration to define the handler of the log stream. -
CONFIG_FLUSH
public static final java.lang.String CONFIG_FLUSHThe name of the configuration key determining to always flush the output file stream after writing each record. -
CONFIG_COMPRESSION_FILTER
public static final java.lang.String CONFIG_COMPRESSION_FILTERThe name of the configuration key to select a compression for the record log files. -
CONFIG_BUFFERSIZE
public static final java.lang.String CONFIG_BUFFERSIZEThe name of the configuration key for the buffer size.
-
-
Constructor Details
-
FileWriter
public FileWriter(kieker.common.configuration.Configuration configuration) throws java.io.IOExceptionCreate a generic file writer.- Parameters:
configuration- Kieker configuration object.- Throws:
java.io.IOException
-
-
Method Details
-
onNewRegistryEntry
public void onNewRegistryEntry(java.lang.String value, int id)- Specified by:
onNewRegistryEntryin interfacekieker.common.registry.IRegistryListener<java.lang.String>
-
onStarting
public void onStarting()Description copied from class:AbstractMonitoringWriterThis event fires when Kieker has been initialized and is ready to monitor. It is executed by theMonitoringWriterThreadjust before reading the writer queue.- Specified by:
onStartingin classAbstractMonitoringWriter
-
writeMonitoringRecord
public void writeMonitoringRecord(kieker.common.record.IMonitoringRecord record)Description copied from class:AbstractMonitoringWriterThis event fires when Kieker has received a new record.- Specified by:
writeMonitoringRecordin classAbstractMonitoringWriter
-
onTerminating
public void onTerminating()Description copied from class:AbstractMonitoringWriterThis event fires when Kieker has been notified to terminate. It is executed by theMonitoringWriterThreadjust after finishing the writer queue.- Specified by:
onTerminatingin classAbstractMonitoringWriter
-
toString
public java.lang.String toString()Returns a textual representation of the writer's configuration.- Overrides:
toStringin classAbstractMonitoringWriter- Returns:
- a textual representation of the writer's configuration
-