public class GangliaReporter extends AbstractPollingReporter implements MetricProcessor<String>
Modifier and Type | Field and Description |
---|---|
boolean |
printVMMetrics |
Constructor and Description |
---|
GangliaReporter(MetricsRegistry metricsRegistry,
String gangliaHost,
int port,
String groupPrefix)
Creates a new
GangliaReporter . |
GangliaReporter(MetricsRegistry metricsRegistry,
String gangliaHost,
int port,
String groupPrefix,
MetricPredicate predicate)
Creates a new
GangliaReporter . |
GangliaReporter(MetricsRegistry metricsRegistry,
String gangliaHost,
int port,
String groupPrefix,
MetricPredicate predicate,
boolean compressPackageNames)
Creates a new
GangliaReporter . |
GangliaReporter(MetricsRegistry metricsRegistry,
String groupPrefix,
MetricPredicate predicate,
boolean compressPackageNames,
com.yammer.metrics.reporting.GangliaMessageBuilder gangliaMessageBuilder,
VirtualMachineMetrics vm)
Creates a new
GangliaReporter . |
GangliaReporter(String gangliaHost,
int port)
Creates a new
GangliaReporter . |
GangliaReporter(String gangliaHost,
int port,
boolean compressPackageNames)
Creates a new
GangliaReporter . |
Modifier and Type | Method and Description |
---|---|
static void |
enable(long period,
TimeUnit unit,
String gangliaHost,
int port)
Enables the ganglia reporter to send data for the default metrics registry to ganglia server
with the specified period.
|
static void |
enable(long period,
TimeUnit unit,
String gangliaHost,
int port,
boolean compressPackageNames)
Enables the ganglia reporter to send data for the default metrics registry to ganglia server
with the specified period.
|
static void |
enable(long period,
TimeUnit unit,
String gangliaHost,
int port,
String groupPrefix)
Enables the ganglia reporter to send data for the default metrics registry to ganglia server
with the specified period.
|
static void |
enable(MetricsRegistry metricsRegistry,
long period,
TimeUnit unit,
String gangliaHost,
int port,
String groupPrefix)
Enables the ganglia reporter to send data for the given metrics registry to ganglia server
with the specified period.
|
static void |
enable(MetricsRegistry metricsRegistry,
long period,
TimeUnit unit,
String gangliaHost,
int port,
String groupPrefix,
MetricPredicate predicate)
Enables the ganglia reporter to send data to ganglia server with the specified period.
|
static void |
enable(MetricsRegistry metricsRegistry,
long period,
TimeUnit unit,
String gangliaHost,
int port,
String groupPrefix,
MetricPredicate predicate,
boolean compressPackageNames)
Enables the ganglia reporter to send data to ganglia server with the specified period.
|
void |
processCounter(MetricName name,
Counter counter,
String x)
Process the given counter.
|
void |
processGauge(MetricName name,
Gauge<?> gauge,
String x)
Process the given gauge.
|
void |
processHistogram(MetricName name,
Histogram histogram,
String x)
Process the given histogram.
|
void |
processMeter(MetricName name,
Metered meter,
String x)
Process the given
Metered instance. |
void |
processTimer(MetricName name,
Timer timer,
String x)
Process the given timer.
|
void |
run()
The method called when a a poll is scheduled to occur.
|
protected String |
sanitizeName(MetricName name) |
shutdown, shutdown, start
getMetricsRegistry
public GangliaReporter(String gangliaHost, int port) throws IOException
GangliaReporter
.gangliaHost
- is ganglia serverport
- is port on which ganglia server is runningIOException
- if there is an error connecting to the ganglia serverpublic GangliaReporter(String gangliaHost, int port, boolean compressPackageNames) throws IOException
GangliaReporter
.gangliaHost
- is ganglia serverport
- is port on which ganglia server is runningcompressPackageNames
- whether or not Metrics' package names will be shortenedIOException
- if there is an error connecting to the ganglia serverpublic GangliaReporter(MetricsRegistry metricsRegistry, String gangliaHost, int port, String groupPrefix) throws IOException
GangliaReporter
.metricsRegistry
- the metrics registrygangliaHost
- is ganglia serverport
- is port on which ganglia server is runninggroupPrefix
- prefix to the ganglia group name (such as myapp_counter)IOException
- if there is an error connecting to the ganglia serverpublic GangliaReporter(MetricsRegistry metricsRegistry, String gangliaHost, int port, String groupPrefix, MetricPredicate predicate) throws IOException
GangliaReporter
.metricsRegistry
- the metrics registrygangliaHost
- is ganglia serverport
- is port on which ganglia server is runninggroupPrefix
- prefix to the ganglia group name (such as myapp_counter)predicate
- filters metrics to be reportedIOException
- if there is an error connecting to the ganglia serverpublic GangliaReporter(MetricsRegistry metricsRegistry, String gangliaHost, int port, String groupPrefix, MetricPredicate predicate, boolean compressPackageNames) throws IOException
GangliaReporter
.metricsRegistry
- the metrics registrygangliaHost
- is ganglia serverport
- is port on which ganglia server is runninggroupPrefix
- prefix to the ganglia group name (such as myapp_counter)predicate
- filters metrics to be reportedcompressPackageNames
- if true reporter will compress package names e.g.
com.foo.MetricName becomes c.f.MetricNameIOException
- if there is an error connecting to the ganglia serverpublic GangliaReporter(MetricsRegistry metricsRegistry, String groupPrefix, MetricPredicate predicate, boolean compressPackageNames, com.yammer.metrics.reporting.GangliaMessageBuilder gangliaMessageBuilder, VirtualMachineMetrics vm) throws IOException
GangliaReporter
.metricsRegistry
- the metrics registrygroupPrefix
- prefix to the ganglia group name (such as myapp_counter)predicate
- filters metrics to be reportedcompressPackageNames
- if true reporter will compress package names e.g.
com.foo.MetricName becomes c.f.MetricNamegangliaMessageBuilder
- a GangliaMessageBuilder
instancevm
- a VirtualMachineMetrics
isntanceIOException
- if there is an error connecting to the ganglia serverpublic static void enable(long period, TimeUnit unit, String gangliaHost, int port)
period
- the period between successive outputsunit
- the time unit of period
gangliaHost
- the gangliaHost name of ganglia server (carbon-cache agent)port
- the port number on which the ganglia server is listeningpublic static void enable(long period, TimeUnit unit, String gangliaHost, int port, String groupPrefix)
period
- the period between successive outputsunit
- the time unit of period
gangliaHost
- the gangliaHost name of ganglia server (carbon-cache agent)port
- the port number on which the ganglia server is listeninggroupPrefix
- prefix to the ganglia group name (such as myapp_counter)public static void enable(long period, TimeUnit unit, String gangliaHost, int port, boolean compressPackageNames)
period
- the period between successive outputsunit
- the time unit of period
gangliaHost
- the gangliaHost name of ganglia server (carbon-cache agent)port
- the port number on which the ganglia server is listeningcompressPackageNames
- if true reporter will compress package names e.g.
com.foo.MetricName becomes c.f.MetricNamepublic static void enable(MetricsRegistry metricsRegistry, long period, TimeUnit unit, String gangliaHost, int port, String groupPrefix)
metricsRegistry
- the metrics registryperiod
- the period between successive outputsunit
- the time unit of period
gangliaHost
- the gangliaHost name of ganglia server (carbon-cache agent)port
- the port number on which the ganglia server is listeninggroupPrefix
- prefix to the ganglia group name (such as myapp_counter)public static void enable(MetricsRegistry metricsRegistry, long period, TimeUnit unit, String gangliaHost, int port, String groupPrefix, MetricPredicate predicate)
metricsRegistry
- the metrics registryperiod
- the period between successive outputsunit
- the time unit of period
gangliaHost
- the gangliaHost name of ganglia server (carbon-cache agent)port
- the port number on which the ganglia server is listeninggroupPrefix
- prefix to the ganglia group name (such as myapp_counter)predicate
- filters metrics to be reportedpublic static void enable(MetricsRegistry metricsRegistry, long period, TimeUnit unit, String gangliaHost, int port, String groupPrefix, MetricPredicate predicate, boolean compressPackageNames)
metricsRegistry
- the metrics registryperiod
- the period between successive outputsunit
- the time unit of period
gangliaHost
- the gangliaHost name of ganglia server (carbon-cache agent)port
- the port number on which the ganglia server is listeninggroupPrefix
- prefix to the ganglia group name (such as myapp_counter)predicate
- filters metrics to be reportedcompressPackageNames
- if true reporter will compress package names e.g.
com.foo.MetricName becomes c.f.MetricNamepublic void run()
AbstractPollingReporter
run
in interface Runnable
run
in class AbstractPollingReporter
public void processGauge(MetricName name, Gauge<?> gauge, String x) throws IOException
MetricProcessor
processGauge
in interface MetricProcessor<String>
name
- the name of the gaugegauge
- the gaugex
- the context of the meterIOException
public void processCounter(MetricName name, Counter counter, String x) throws IOException
MetricProcessor
processCounter
in interface MetricProcessor<String>
name
- the name of the countercounter
- the counterx
- the context of the meterIOException
public void processMeter(MetricName name, Metered meter, String x) throws IOException
MetricProcessor
Metered
instance.processMeter
in interface MetricProcessor<String>
name
- the name of the metermeter
- the meterx
- the context of the meterIOException
public void processHistogram(MetricName name, Histogram histogram, String x) throws IOException
MetricProcessor
processHistogram
in interface MetricProcessor<String>
name
- the name of the histogramhistogram
- the histogramx
- the context of the meterIOException
public void processTimer(MetricName name, Timer timer, String x) throws IOException
MetricProcessor
processTimer
in interface MetricProcessor<String>
name
- the name of the timertimer
- the timerx
- the context of the meterIOException
protected String sanitizeName(MetricName name)
Copyright © 2014. All Rights Reserved.