Package org.jmxtrans.agent
Class StatsDOutputWriter
java.lang.Object
org.jmxtrans.agent.AbstractOutputWriter
org.jmxtrans.agent.StatsDOutputWriter
- All Implemented Interfaces:
OutputWriter
public class StatsDOutputWriter extends AbstractOutputWriter implements OutputWriter
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringmetricNamePrefixstatic java.lang.StringSETTING_BUFFER_SIZEstatic java.lang.StringSETTING_HOSTstatic java.lang.StringSETTING_PORTstatic java.lang.StringSETTING_ROOT_PREFIXstatic java.lang.StringSETTINGS_STATSD_TYPEstatic java.lang.StringSETTINGS_TAGSstatic java.lang.StringSTATSD_DATADOGstatic java.lang.StringSTATSD_SYSDIGprotected java.lang.StringstatsTypeprotected java.util.List<Tag>tagsFields inherited from class org.jmxtrans.agent.AbstractOutputWriter
logger, SETTING_LOG_LEVEL, SETTING_LOG_LEVEL_DEFAULT_VALUE -
Constructor Summary
Constructors Constructor Description StatsDOutputWriter() -
Method Summary
Modifier and Type Method Description protected java.lang.StringbuildMetricsString(java.lang.String metricName, java.lang.String metricType, java.lang.String strValue)protected booleandoSend(java.lang.String stat)booleanflush()protected java.lang.StringgetHostName()protected voidparseTagsAndMetricsNamePrefix(java.util.Map<java.lang.String,java.lang.String> settings)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)voidwriteInvocationResult(java.lang.String invocationName, java.lang.Object value)voidwriteQueryResult(java.lang.String metricName, java.lang.String metricType, java.lang.Object value)Methods inherited from class org.jmxtrans.agent.AbstractOutputWriter
getDebugLevel, getInfoLevel, getTraceLevel, preCollect, preDestroyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jmxtrans.agent.OutputWriter
preCollect, preDestroy
-
Field Details
-
SETTING_HOST
public static final java.lang.String SETTING_HOST- See Also:
- Constant Field Values
-
SETTING_PORT
public static final java.lang.String SETTING_PORT- See Also:
- Constant Field Values
-
SETTING_ROOT_PREFIX
public static final java.lang.String SETTING_ROOT_PREFIX- See Also:
- Constant Field Values
-
SETTING_BUFFER_SIZE
public static final java.lang.String SETTING_BUFFER_SIZE- See Also:
- Constant Field Values
-
SETTINGS_STATSD_TYPE
public static final java.lang.String SETTINGS_STATSD_TYPE- See Also:
- Constant Field Values
-
STATSD_DATADOG
public static final java.lang.String STATSD_DATADOG- See Also:
- Constant Field Values
-
STATSD_SYSDIG
public static final java.lang.String STATSD_SYSDIG- See Also:
- Constant Field Values
-
SETTINGS_TAGS
public static final java.lang.String SETTINGS_TAGS- See Also:
- Constant Field Values
-
tags
-
metricNamePrefix
protected java.lang.String metricNamePrefix -
statsType
protected java.lang.String statsType
-
-
Constructor Details
-
StatsDOutputWriter
public StatsDOutputWriter()
-
-
Method Details
-
parseTagsAndMetricsNamePrefix
protected void parseTagsAndMetricsNamePrefix(java.util.Map<java.lang.String,java.lang.String> settings) -
postConstruct
public void postConstruct(java.util.Map<java.lang.String,java.lang.String> settings)- Specified by:
postConstructin interfaceOutputWriter- Overrides:
postConstructin classAbstractOutputWriter
-
getHostName
protected java.lang.String getHostName() -
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- Overrides:
postCollectin classAbstractOutputWriter- Throws:
java.io.IOException
-
writeInvocationResult
public void writeInvocationResult(java.lang.String invocationName, java.lang.Object value) throws java.io.IOException- Specified by:
writeInvocationResultin interfaceOutputWriter- Specified by:
writeInvocationResultin classAbstractOutputWriter- Throws:
java.io.IOException
-
buildMetricsString
protected java.lang.String buildMetricsString(java.lang.String metricName, java.lang.String metricType, java.lang.String strValue) -
writeQueryResult
public void writeQueryResult(java.lang.String metricName, java.lang.String metricType, java.lang.Object value) throws java.io.IOException- Specified by:
writeQueryResultin interfaceOutputWriter- Specified by:
writeQueryResultin classAbstractOutputWritermetricType- seeQuery.type- Throws:
java.io.IOException
-
doSend
protected boolean doSend(java.lang.String stat) -
flush
public boolean flush()
-