Package org.jmxtrans.embedded.output
Class GraphitePickleWriter
java.lang.Object
org.jmxtrans.embedded.output.AbstractOutputWriter
org.jmxtrans.embedded.output.GraphitePickleWriter
- All Implemented Interfaces:
OutputWriter
public class GraphitePickleWriter extends AbstractOutputWriter implements OutputWriter
Graphite implementation of the OutputWriter.
This implementation uses
Carbon Pickle protocol over TCP/IP.
Settings:
- "host": hostname or ip address of the Graphite server. Mandatory
- "port": listen port for the TCP Plain Text Protocol of the Graphite server. Optional, default value: 2004.
- "namePrefix": prefix append to the metrics name. Optional, default value: "servers.#hostname#.".
- "enabled": flag to enable/disable the writer. Optional, default value: {$code true}.
- "graphite.socketConnectTimeoutInMillis": timeout for the socketConnect in millis.
Optional, default value
SocketOutputStreamPoolFactory.DEFAULT_SOCKET_CONNECT_TIMEOUT_IN_MILLIS
All the results of write(Iterable) are sent in one single cPickle message.
- Author:
- Cyrille Le Clerc
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_GRAPHITE_SERVER_PORTstatic StringDEFAULT_NAME_PREFIXFields inherited from class org.jmxtrans.embedded.output.AbstractOutputWriter
SETTING_HOST, SETTING_NAME_PREFIX, SETTING_PORT, SETTING_PROTOCOL, SETTING_PROXY_HOST, SETTING_PROXY_PORT, SETTING_SOCKET_FACTORY, SETTING_TLS_INSECURE, SETTING_TLS_KEY_STORE, SETTING_TLS_KEY_STORE_PASSWORD, SETTING_TLS_TRUST_STORE, SETTING_TLS_TRUST_STORE_PASSWORD, SETTING_TOKEN, SETTING_URL, SETTING_USE_TLS, SETTING_USERNAME -
Constructor Summary
Constructors Constructor Description GraphitePickleWriter() -
Method Summary
Modifier and Type Method Description voidstart()Load settings, initialize theSocketWriterpool and test the connection to the graphite server.voidstop()Close theSocketWriterpool.voidwrite(Iterable<QueryResult> results)Send given metrics to the Graphite server.Methods inherited from class org.jmxtrans.embedded.output.AbstractOutputWriter
equals, getBooleanSetting, getIntSetting, getIntSetting, getLongSetting, getSettings, getStrategy, getStringSetting, getStringSetting, hashCode, isEnabled, setEnabled, setSettings, setStrategy, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jmxtrans.embedded.output.OutputWriter
getSettings, isEnabled, setEnabled, setSettings
-
Field Details
-
DEFAULT_GRAPHITE_SERVER_PORT
public static final int DEFAULT_GRAPHITE_SERVER_PORT- See Also:
- Constant Field Values
-
DEFAULT_NAME_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Details
-
GraphitePickleWriter
public GraphitePickleWriter()
-
-
Method Details
-
start
public void start()Load settings, initialize theSocketWriterpool and test the connection to the graphite server. aLogger.warn(String)message is emitted if the connection to the graphite server fails.- Specified by:
startin interfaceOutputWriter- Overrides:
startin classAbstractOutputWriter
-
write
Send given metrics to the Graphite server.- Specified by:
writein interfaceOutputWriter- Specified by:
writein classAbstractOutputWriter
-
stop
Close theSocketWriterpool.- Specified by:
stopin interfaceOutputWriter- Overrides:
stopin classAbstractOutputWriter- Throws:
Exception
-