com.codahale.metrics.graphite.PickledGraphite Java Examples
The following examples show how to use
com.codahale.metrics.graphite.PickledGraphite.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GraphiteSenderProvider.java From graylog-plugin-metrics-reporter with GNU General Public License v3.0 | 6 votes |
@Override public GraphiteSender get() { HostAndPort hostAndPort = configuration.getAddress(); String host = hostAndPort.getHost(); int port = hostAndPort.getPortOrDefault(2003); switch (configuration.getProtocol()) { case PICKLE: return new PickledGraphite( host, port, SocketFactory.getDefault(), configuration.getCharset(), configuration.getPickleBatchSize()); case TCP: return new Graphite(host, port, SocketFactory.getDefault(), configuration.getCharset()); case UDP: return new GraphiteUDP(host, port); default: throw new IllegalArgumentException("Unknown Graphite protocol \"" + configuration.getProtocol() + "\""); } }
Example #2
Source File: GraphiteSenderProviderTest.java From graylog-plugin-metrics-reporter with GNU General Public License v3.0 | 5 votes |
@Test public void getReturnsGraphitePickledGraphite() throws Exception { final MetricsGraphiteReporterConfiguration configuration = new MetricsGraphiteReporterConfiguration() { @Override public GraphiteProtocol getProtocol() { return GraphiteProtocol.PICKLE; } }; final GraphiteSenderProvider provider = new GraphiteSenderProvider(configuration); final GraphiteSender graphiteSender = provider.get(); assertTrue(graphiteSender instanceof PickledGraphite); assertFalse(graphiteSender.isConnected()); }