public class UnregisteredMetricsGroup extends Object implements MetricGroup
MetricGroup
that does not register any metrics at the metrics registry and any
reporters.Constructor and Description |
---|
UnregisteredMetricsGroup() |
Modifier and Type | Method and Description |
---|---|
MetricGroup |
addGroup(int name)
Creates a new MetricGroup and adds it to this groups sub-groups.
|
MetricGroup |
addGroup(String name)
Creates a new MetricGroup and adds it to this groups sub-groups.
|
MetricGroup |
addGroup(String key,
String value)
Creates a new key-value MetricGroup pair.
|
Counter |
counter(int name)
Creates and registers a new
Counter with Flink. |
<C extends Counter> |
counter(int name,
C counter)
Registers a
Counter with Flink. |
Counter |
counter(String name)
Creates and registers a new
Counter with Flink. |
<C extends Counter> |
counter(String name,
C counter)
Registers a
Counter with Flink. |
<T,G extends Gauge<T>> |
gauge(int name,
G gauge)
Registers a new
Gauge with Flink. |
<T,G extends Gauge<T>> |
gauge(String name,
G gauge)
Registers a new
Gauge with Flink. |
Map<String,String> |
getAllVariables()
Returns a map of all variables and their associated value, for example
{"<host>"="host-7", "<tm_id>"="taskmanager-2"} . |
String |
getMetricIdentifier(String metricName)
Returns the fully qualified metric name, for example
"host-7.taskmanager-2.window_word_count.my-mapper.metricName" . |
String |
getMetricIdentifier(String metricName,
CharacterFilter filter)
Returns the fully qualified metric name, for example
"host-7.taskmanager-2.window_word_count.my-mapper.metricName" . |
String[] |
getScopeComponents()
Gets the scope as an array of the scope components, for example
["host-7",
"taskmanager-2", "window_word_count", "my-mapper"] . |
<H extends Histogram> |
histogram(int name,
H histogram)
Registers a new
Histogram with Flink. |
<H extends Histogram> |
histogram(String name,
H histogram)
Registers a new
Histogram with Flink. |
<M extends Meter> |
meter(int name,
M meter)
Registers a new
Meter with Flink. |
<M extends Meter> |
meter(String name,
M meter)
Registers a new
Meter with Flink. |
public Counter counter(int name)
MetricGroup
Counter
with Flink.counter
in interface MetricGroup
name
- name of the counterpublic Counter counter(String name)
MetricGroup
Counter
with Flink.counter
in interface MetricGroup
name
- name of the counterpublic <C extends Counter> C counter(int name, C counter)
MetricGroup
Counter
with Flink.counter
in interface MetricGroup
C
- counter typename
- name of the countercounter
- counter to registerpublic <C extends Counter> C counter(String name, C counter)
MetricGroup
Counter
with Flink.counter
in interface MetricGroup
C
- counter typename
- name of the countercounter
- counter to registerpublic <T,G extends Gauge<T>> G gauge(int name, G gauge)
MetricGroup
Gauge
with Flink.gauge
in interface MetricGroup
T
- return type of the gaugename
- name of the gaugegauge
- gauge to registerpublic <T,G extends Gauge<T>> G gauge(String name, G gauge)
MetricGroup
Gauge
with Flink.gauge
in interface MetricGroup
T
- return type of the gaugename
- name of the gaugegauge
- gauge to registerpublic <H extends Histogram> H histogram(int name, H histogram)
MetricGroup
Histogram
with Flink.histogram
in interface MetricGroup
H
- histogram typename
- name of the histogramhistogram
- histogram to registerpublic <M extends Meter> M meter(String name, M meter)
MetricGroup
Meter
with Flink.meter
in interface MetricGroup
M
- meter typename
- name of the metermeter
- meter to registerpublic <M extends Meter> M meter(int name, M meter)
MetricGroup
Meter
with Flink.meter
in interface MetricGroup
M
- meter typename
- name of the metermeter
- meter to registerpublic <H extends Histogram> H histogram(String name, H histogram)
MetricGroup
Histogram
with Flink.histogram
in interface MetricGroup
H
- histogram typename
- name of the histogramhistogram
- histogram to registerpublic MetricGroup addGroup(int name)
MetricGroup
addGroup
in interface MetricGroup
name
- name of the grouppublic MetricGroup addGroup(String name)
MetricGroup
addGroup
in interface MetricGroup
name
- name of the grouppublic MetricGroup addGroup(String key, String value)
MetricGroup
The only difference between calling this method and group.addGroup(key).addGroup(value)
is that MetricGroup.getAllVariables()
of the value group
return an additional "<key>"="value"
pair.
addGroup
in interface MetricGroup
key
- name of the first groupvalue
- name of the second grouppublic String[] getScopeComponents()
MetricGroup
["host-7",
"taskmanager-2", "window_word_count", "my-mapper"]
.getScopeComponents
in interface MetricGroup
MetricGroup.getMetricIdentifier(String)
,
MetricGroup.getMetricIdentifier(String, CharacterFilter)
public Map<String,String> getAllVariables()
MetricGroup
{"<host>"="host-7", "<tm_id>"="taskmanager-2"}
.getAllVariables
in interface MetricGroup
public String getMetricIdentifier(String metricName)
MetricGroup
"host-7.taskmanager-2.window_word_count.my-mapper.metricName"
.getMetricIdentifier
in interface MetricGroup
metricName
- metric namepublic String getMetricIdentifier(String metricName, CharacterFilter filter)
MetricGroup
"host-7.taskmanager-2.window_word_count.my-mapper.metricName"
.getMetricIdentifier
in interface MetricGroup
metricName
- metric namefilter
- character filter which is applied to the scope components if not null.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.