Package org.apache.flink.metrics.groups
Class UnregisteredMetricsGroup
- java.lang.Object
-
- org.apache.flink.metrics.groups.UnregisteredMetricsGroup
-
- All Implemented Interfaces:
MetricGroup
@Internal public class UnregisteredMetricsGroup extends Object implements MetricGroup
A specialMetricGroup
that does not register any metrics at the metrics registry and any reporters.
-
-
Constructor Summary
Constructors Constructor Description UnregisteredMetricsGroup()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(String name)
Creates and registers a newCounter
with Flink.<C extends Counter>
Ccounter(String name, C counter)
Registers aCounter
with Flink.static CacheMetricGroup
createCacheMetricGroup()
static OperatorIOMetricGroup
createOperatorIOMetricGroup()
static OperatorMetricGroup
createOperatorMetricGroup()
static SinkWriterMetricGroup
createSinkWriterMetricGroup()
static SourceReaderMetricGroup
createSourceReaderMetricGroup()
static SplitEnumeratorMetricGroup
createSplitEnumeratorMetricGroup()
<T,G extends Gauge<T>>
Ggauge(String name, G gauge)
Registers a newGauge
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>
Hhistogram(String name, H histogram)
Registers a newHistogram
with Flink.<M extends Meter>
Mmeter(String name, M meter)
Registers a newMeter
with Flink.
-
-
-
Method Detail
-
counter
public Counter counter(String name)
Description copied from interface:MetricGroup
Creates and registers a newCounter
with Flink.- Specified by:
counter
in interfaceMetricGroup
- Parameters:
name
- name of the counter- Returns:
- the created counter
-
counter
public <C extends Counter> C counter(String name, C counter)
Description copied from interface:MetricGroup
Registers aCounter
with Flink.- Specified by:
counter
in interfaceMetricGroup
- Type Parameters:
C
- counter type- Parameters:
name
- name of the countercounter
- counter to register- Returns:
- the given counter
-
gauge
public <T,G extends Gauge<T>> G gauge(String name, G gauge)
Description copied from interface:MetricGroup
Registers a newGauge
with Flink.- Specified by:
gauge
in interfaceMetricGroup
- Type Parameters:
T
- return type of the gauge- Parameters:
name
- name of the gaugegauge
- gauge to register- Returns:
- the given gauge
-
meter
public <M extends Meter> M meter(String name, M meter)
Description copied from interface:MetricGroup
Registers a newMeter
with Flink.- Specified by:
meter
in interfaceMetricGroup
- Type Parameters:
M
- meter type- Parameters:
name
- name of the metermeter
- meter to register- Returns:
- the registered meter
-
histogram
public <H extends Histogram> H histogram(String name, H histogram)
Description copied from interface:MetricGroup
Registers a newHistogram
with Flink.- Specified by:
histogram
in interfaceMetricGroup
- Type Parameters:
H
- histogram type- Parameters:
name
- name of the histogramhistogram
- histogram to register- Returns:
- the registered histogram
-
addGroup
public MetricGroup addGroup(String name)
Description copied from interface:MetricGroup
Creates a new MetricGroup and adds it to this groups sub-groups.- Specified by:
addGroup
in interfaceMetricGroup
- Parameters:
name
- name of the group- Returns:
- the created group
-
addGroup
public MetricGroup addGroup(String key, String value)
Description copied from interface:MetricGroup
Creates a new key-value MetricGroup pair. The key group is added to this groups sub-groups, while the value group is added to the key group's sub-groups. This method returns the value group.The only difference between calling this method and
group.addGroup(key).addGroup(value)
is thatMetricGroup.getAllVariables()
of the value group return an additional"<key>"="value"
pair.- Specified by:
addGroup
in interfaceMetricGroup
- Parameters:
key
- name of the first groupvalue
- name of the second group- Returns:
- the second created group
-
getScopeComponents
public String[] getScopeComponents()
Description copied from interface:MetricGroup
Gets the scope as an array of the scope components, for example["host-7", "taskmanager-2", "window_word_count", "my-mapper"]
.- Specified by:
getScopeComponents
in interfaceMetricGroup
- See Also:
MetricGroup.getMetricIdentifier(String)
,MetricGroup.getMetricIdentifier(String, CharacterFilter)
-
getAllVariables
public Map<String,String> getAllVariables()
Description copied from interface:MetricGroup
Returns a map of all variables and their associated value, for example{"<host>"="host-7", "<tm_id>"="taskmanager-2"}
.- Specified by:
getAllVariables
in interfaceMetricGroup
- Returns:
- map of all variables and their associated value
-
getMetricIdentifier
public String getMetricIdentifier(String metricName)
Description copied from interface:MetricGroup
Returns the fully qualified metric name, for example"host-7.taskmanager-2.window_word_count.my-mapper.metricName"
.- Specified by:
getMetricIdentifier
in interfaceMetricGroup
- Parameters:
metricName
- metric name- Returns:
- fully qualified metric name
-
getMetricIdentifier
public String getMetricIdentifier(String metricName, CharacterFilter filter)
Description copied from interface:MetricGroup
Returns the fully qualified metric name, for example"host-7.taskmanager-2.window_word_count.my-mapper.metricName"
.- Specified by:
getMetricIdentifier
in interfaceMetricGroup
- Parameters:
metricName
- metric namefilter
- character filter which is applied to the scope components if not null.- Returns:
- fully qualified metric name
-
createOperatorMetricGroup
public static OperatorMetricGroup createOperatorMetricGroup()
-
createOperatorIOMetricGroup
public static OperatorIOMetricGroup createOperatorIOMetricGroup()
-
createSourceReaderMetricGroup
public static SourceReaderMetricGroup createSourceReaderMetricGroup()
-
createSplitEnumeratorMetricGroup
public static SplitEnumeratorMetricGroup createSplitEnumeratorMetricGroup()
-
createCacheMetricGroup
public static CacheMetricGroup createCacheMetricGroup()
-
createSinkWriterMetricGroup
public static SinkWriterMetricGroup createSinkWriterMetricGroup()
-
-