Package org.jmxtrans.agent
Class AbstractOutputWriter
java.lang.Object
org.jmxtrans.agent.AbstractOutputWriter
- All Implemented Interfaces:
OutputWriter
- Direct Known Subclasses:
ConsoleOutputWriter,DevNullOutputWriter,FileOverwriterOutputWriter,GraphitePlainTextTcpOutputWriter,GraphiteUdpOutputWriter,InfluxDbOutputWriter,LibratoWriter,OutputWritersChain,PerMinuteSummarizerOutputWriter,RollingFileOutputWriter,StackdriverWriter,StatsDOutputWriter,ZabbixTcpOutputWriter
public abstract class AbstractOutputWriter extends Object implements OutputWriter
- Author:
- Cyrille Le Clerc
-
Field Summary
Fields Modifier and Type Field Description protected Loggerloggerstatic StringSETTING_LOG_LEVELDefine the level of log message to display tweaking java.util.logging configuration.static StringSETTING_LOG_LEVEL_DEFAULT_VALUE -
Constructor Summary
Constructors Constructor Description AbstractOutputWriter() -
Method Summary
Modifier and Type Method Description protected LevelgetDebugLevel()To workaround the complex configuration of java.util.logging, we tweak the level for "debug style" messages using the "logLevel" initialization parameter.protected LevelgetInfoLevel()To workaround the complex configuration of java.util.logging, we tweak the level for "info style" messages using the "logLevel" initialization parameter.protected LevelgetTraceLevel()To workaround the complex configuration of java.util.logging, we tweak the level for "trace style" messages using the "logLevel" initialization parameter.voidpostCollect()called after a serie of writes, typically at the end of a collection.voidpostConstruct(Map<String,String> settings)voidpreCollect()Called before metrics collection startsvoidpreDestroy()abstract voidwriteInvocationResult(String invocationName, Object value)abstract voidwriteQueryResult(String metricName, String metricType, Object value)
-
Field Details
-
SETTING_LOG_LEVEL
Define the level of log message to display tweaking java.util.logging configuration. Supported values areINFO- See Also:
- Constant Field Values
-
SETTING_LOG_LEVEL_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
logger
-
-
Constructor Details
-
AbstractOutputWriter
public AbstractOutputWriter()
-
-
Method Details
-
postConstruct
- Specified by:
postConstructin interfaceOutputWriter
-
preDestroy
public void preDestroy()- Specified by:
preDestroyin interfaceOutputWriter
-
postCollect
Description copied from interface:OutputWritercalled after a serie of writes, typically at the end of a collection.
Useful with batch writers.
- Specified by:
postCollectin interfaceOutputWriter- Throws:
IOException
-
preCollect
Description copied from interface:OutputWriterCalled before metrics collection starts- Specified by:
preCollectin interfaceOutputWriter- Throws:
IOException
-
writeInvocationResult
public abstract void writeInvocationResult(@Nonnull String invocationName, @Nullable Object value) throws IOException- Specified by:
writeInvocationResultin interfaceOutputWriter- Throws:
IOException
-
writeQueryResult
public abstract void writeQueryResult(@Nonnull String metricName, @Nullable String metricType, @Nullable Object value) throws IOException- Specified by:
writeQueryResultin interfaceOutputWritermetricType- seeQuery.type- Throws:
IOException
-
getDebugLevel
To workaround the complex configuration of java.util.logging, we tweak the level for "debug style" messages using the "logLevel" initialization parameter. -
getTraceLevel
To workaround the complex configuration of java.util.logging, we tweak the level for "trace style" messages using the "logLevel" initialization parameter. -
getInfoLevel
To workaround the complex configuration of java.util.logging, we tweak the level for "info style" messages using the "logLevel" initialization parameter.
-