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 java.lang.Object implements OutputWriter
- Author:
- Cyrille Le Clerc
-
Field Summary
Fields Modifier and Type Field Description protected Loggerloggerstatic java.lang.StringSETTING_LOG_LEVELDefine the level of log message to display tweaking java.util.logging configuration.static java.lang.StringSETTING_LOG_LEVEL_DEFAULT_VALUE -
Constructor Summary
Constructors Constructor Description AbstractOutputWriter() -
Method Summary
Modifier and Type Method Description protected java.util.logging.LevelgetDebugLevel()To workaround the complex configuration of java.util.logging, we tweak the level for "debug style" messages using the "logLevel" initialization parameter.protected java.util.logging.LevelgetInfoLevel()To workaround the complex configuration of java.util.logging, we tweak the level for "info style" messages using the "logLevel" initialization parameter.protected java.util.logging.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(java.util.Map<java.lang.String,java.lang.String> settings)voidpreCollect()Called before metrics collection startsvoidpreDestroy()abstract voidwriteInvocationResult(java.lang.String invocationName, java.lang.Object value)abstract voidwriteQueryResult(java.lang.String metricName, java.lang.String metricType, java.lang.Object value)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
SETTING_LOG_LEVEL
public static final java.lang.String SETTING_LOG_LEVELDefine 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
public static final java.lang.String SETTING_LOG_LEVEL_DEFAULT_VALUE- See Also:
- Constant Field Values
-
logger
-
-
Constructor Details
-
AbstractOutputWriter
public AbstractOutputWriter()
-
-
Method Details
-
postConstruct
public void postConstruct(@Nonnull java.util.Map<java.lang.String,java.lang.String> settings)- Specified by:
postConstructin interfaceOutputWriter
-
preDestroy
public void preDestroy()- Specified by:
preDestroyin interfaceOutputWriter
-
postCollect
public void postCollect() throws java.io.IOExceptionDescription 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:
java.io.IOException
-
preCollect
public void preCollect() throws java.io.IOExceptionDescription copied from interface:OutputWriterCalled before metrics collection starts- Specified by:
preCollectin interfaceOutputWriter- Throws:
java.io.IOException
-
writeInvocationResult
public abstract void writeInvocationResult(@Nonnull java.lang.String invocationName, @Nullable java.lang.Object value) throws java.io.IOException- Specified by:
writeInvocationResultin interfaceOutputWriter- Throws:
java.io.IOException
-
writeQueryResult
public abstract void writeQueryResult(@Nonnull java.lang.String metricName, @Nullable java.lang.String metricType, @Nullable java.lang.Object value) throws java.io.IOException- Specified by:
writeQueryResultin interfaceOutputWritermetricType- seeQuery.type- Throws:
java.io.IOException
-
getDebugLevel
@Nonnull protected java.util.logging.Level getDebugLevel()To workaround the complex configuration of java.util.logging, we tweak the level for "debug style" messages using the "logLevel" initialization parameter. -
getTraceLevel
@Nonnull protected java.util.logging.Level getTraceLevel()To workaround the complex configuration of java.util.logging, we tweak the level for "trace style" messages using the "logLevel" initialization parameter. -
getInfoLevel
@Nonnull protected java.util.logging.Level getInfoLevel()To workaround the complex configuration of java.util.logging, we tweak the level for "info style" messages using the "logLevel" initialization parameter.
-