Package org.dhatim.dropwizard.prometheus
Class Pushgateway
- java.lang.Object
-
- org.dhatim.dropwizard.prometheus.Pushgateway
-
- All Implemented Interfaces:
Closeable,AutoCloseable,PrometheusSender
public class Pushgateway extends Object implements PrometheusSender
-
-
Constructor Summary
Constructors Constructor Description Pushgateway(String url)Pushgateway(String url, String job)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidconnect()Connects to the server.voidflush()Flushes buffer, if applicablebooleanisConnected()Returns true if ready to send datavoidsendCounter(String name, com.codahale.metrics.Counter counter)voidsendGauge(String name, com.codahale.metrics.Gauge<?> gauge)voidsendHistogram(String name, com.codahale.metrics.Histogram histogram)voidsendMeter(String name, com.codahale.metrics.Meter meter)voidsendTimer(String name, com.codahale.metrics.Timer timer)
-
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
connect
public void connect() throws IOExceptionDescription copied from interface:PrometheusSenderConnects to the server.- Specified by:
connectin interfacePrometheusSender- Throws:
IOException- if there is an error connecting
-
sendGauge
public void sendGauge(String name, com.codahale.metrics.Gauge<?> gauge) throws IOException
- Specified by:
sendGaugein interfacePrometheusSender- Throws:
IOException
-
sendCounter
public void sendCounter(String name, com.codahale.metrics.Counter counter) throws IOException
- Specified by:
sendCounterin interfacePrometheusSender- Throws:
IOException
-
sendHistogram
public void sendHistogram(String name, com.codahale.metrics.Histogram histogram) throws IOException
- Specified by:
sendHistogramin interfacePrometheusSender- Throws:
IOException
-
sendMeter
public void sendMeter(String name, com.codahale.metrics.Meter meter) throws IOException
- Specified by:
sendMeterin interfacePrometheusSender- Throws:
IOException
-
sendTimer
public void sendTimer(String name, com.codahale.metrics.Timer timer) throws IOException
- Specified by:
sendTimerin interfacePrometheusSender- Throws:
IOException
-
flush
public void flush() throws IOExceptionDescription copied from interface:PrometheusSenderFlushes buffer, if applicable- Specified by:
flushin interfacePrometheusSender- Throws:
IOException- if there is an error connecting
-
isConnected
public boolean isConnected()
Description copied from interface:PrometheusSenderReturns true if ready to send data- Specified by:
isConnectedin interfacePrometheusSender- Returns:
- connection status
-
-