public class GiraphMetricsRegistry extends Object
Modifier | Constructor and Description |
---|---|
protected |
GiraphMetricsRegistry(com.yammer.metrics.core.MetricsRegistry registry,
com.yammer.metrics.reporting.JmxReporter reporter,
String groupName,
String type)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static GiraphMetricsRegistry |
create(GiraphConfiguration conf,
String groupName,
String type)
Create registry with Hadoop Configuration and group to use for metrics.
|
static GiraphMetricsRegistry |
createFake()
Create no-op empty registry that makes no-op metrics.
|
static GiraphMetricsRegistry |
createWithOptional(String groupName,
String type)
Create registry with group to use for metrics.
|
Map<com.yammer.metrics.core.MetricName,com.yammer.metrics.core.Metric> |
getAll()
Get map of all metrics.
|
com.yammer.metrics.core.Histogram |
getBiasedHistogram(String name)
Creates a new biased
Histogram and registers it under the given
group and name |
com.yammer.metrics.core.Counter |
getCounter(String name)
Creates a new
Counter and registers it
under the given group and name. |
<T> com.yammer.metrics.core.Gauge<T> |
getExistingGauge(String name)
Get a Gauge that is already present in the MetricsRegistry
|
<T> com.yammer.metrics.core.Gauge<T> |
getGauge(String name,
com.yammer.metrics.core.Gauge<T> metric)
Given a new
Gauge , registers it under the
given group and name. |
String |
getGroupName()
Get group name used for metrics.
|
protected com.yammer.metrics.core.MetricsRegistry |
getInternalRegistry()
Get internal MetricsRegistry used.
|
com.yammer.metrics.core.Meter |
getMeter(MeterDesc meterDesc)
Creates a new
Meter and registers it under
the given group and name. |
com.yammer.metrics.core.Meter |
getMeter(String name,
String eventType,
TimeUnit timeUnit)
Creates a new
Meter and registers it under
the given group and name. |
com.yammer.metrics.core.Timer |
getTimer(String name,
TimeUnit durationUnit,
TimeUnit rateUnit)
Creates a new
Timer and registers it under the given
group and name. |
String |
getType()
Get type used for new metrics created
|
com.yammer.metrics.core.Histogram |
getUniformHistogram(String name)
Creates a new uniform
Histogram and registers it under the given
group and name |
protected com.yammer.metrics.core.MetricName |
makeMetricName(String name)
Create a MetricName using the job ID, group, and name.
|
void |
printToStream(PrintStream out)
Dump all the metrics to the PrintStream provided.
|
protected void |
setGroupName(String groupName)
Set group name used by this MetricsRegistry.
|
void |
setType(String type)
Set type to use for new metrics
|
void |
shutdown()
Nothing will be captured after this is called.
|
protected GiraphMetricsRegistry(com.yammer.metrics.core.MetricsRegistry registry, com.yammer.metrics.reporting.JmxReporter reporter, String groupName, String type)
registry
- MetricsRegistry
to usereporter
- JmxReporter
to usegroupName
- String grouping for metricstype
- String type name for metricspublic static GiraphMetricsRegistry createFake()
public static GiraphMetricsRegistry createWithOptional(String groupName, String type)
groupName
- String group to use for metrics.type
- String type to use for metrics.public static GiraphMetricsRegistry create(GiraphConfiguration conf, String groupName, String type)
conf
- Hadoop Configuration to use.groupName
- String group to use for metrics.type
- String type to use for metrics.public Map<com.yammer.metrics.core.MetricName,com.yammer.metrics.core.Metric> getAll()
public String getGroupName()
protected void setGroupName(String groupName)
groupName
- String group name to use.public String getType()
public void setType(String type)
type
- String type to usepublic void printToStream(PrintStream out)
out
- PrintStream to write metrics to.protected com.yammer.metrics.core.MetricsRegistry getInternalRegistry()
public com.yammer.metrics.core.Counter getCounter(String name)
Counter
and registers it
under the given group and name.name
- the name of the metricCounter
public <T> com.yammer.metrics.core.Gauge<T> getGauge(String name, com.yammer.metrics.core.Gauge<T> metric)
Gauge
, registers it under the
given group and name.T
- the type of the value returned by the metricname
- the name of the metricmetric
- the metricmetric
public com.yammer.metrics.core.Histogram getBiasedHistogram(String name)
Histogram
and registers it under the given
group and namename
- name of metricHistogram
public com.yammer.metrics.core.Histogram getUniformHistogram(String name)
Histogram
and registers it under the given
group and namename
- name of metricHistogram
public com.yammer.metrics.core.Meter getMeter(MeterDesc meterDesc)
Meter
and registers it under
the given group and name.meterDesc
- description of meterMeter
public com.yammer.metrics.core.Meter getMeter(String name, String eventType, TimeUnit timeUnit)
Meter
and registers it under
the given group and name.name
- the name of the metriceventType
- the plural name of the type of events the meter is
measuring (e.g., "requests"
)timeUnit
- the rate unit of the new meterMeter
public com.yammer.metrics.core.Timer getTimer(String name, TimeUnit durationUnit, TimeUnit rateUnit)
Timer
and registers it under the given
group and name.name
- the name of the metricdurationUnit
- the duration scale unit of the new timerrateUnit
- the rate scale unit of the new timerTimer
public <T> com.yammer.metrics.core.Gauge<T> getExistingGauge(String name)
T
- type of gaugename
- String name of Gaugeprotected com.yammer.metrics.core.MetricName makeMetricName(String name)
name
- String name given to metricpublic void shutdown()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.