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 specialMetricGroupthat 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 MetricGroupaddGroup(String name)Creates a new MetricGroup and adds it to this groups sub-groups.MetricGroupaddGroup(String key, String value)Creates a new key-value MetricGroup pair.Countercounter(String name)Creates and registers a newCounterwith Flink.<C extends Counter>
Ccounter(String name, C counter)Registers aCounterwith Flink.static CacheMetricGroupcreateCacheMetricGroup()static OperatorIOMetricGroupcreateOperatorIOMetricGroup()static OperatorMetricGroupcreateOperatorMetricGroup()static SinkWriterMetricGroupcreateSinkWriterMetricGroup()static SourceReaderMetricGroupcreateSourceReaderMetricGroup()static SplitEnumeratorMetricGroupcreateSplitEnumeratorMetricGroup()<T,G extends Gauge<T>>
Ggauge(String name, G gauge)Registers a newGaugewith Flink.Map<String,String>getAllVariables()Returns a map of all variables and their associated value, for example{"<host>"="host-7", "<tm_id>"="taskmanager-2"}.StringgetMetricIdentifier(String metricName)Returns the fully qualified metric name, for example"host-7.taskmanager-2.window_word_count.my-mapper.metricName".StringgetMetricIdentifier(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 newHistogramwith Flink.<M extends Meter>
Mmeter(String name, M meter)Registers a newMeterwith Flink.
-
-
-
Method Detail
-
counter
public Counter counter(String name)
Description copied from interface:MetricGroupCreates and registers a newCounterwith Flink.- Specified by:
counterin 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:MetricGroupRegisters aCounterwith Flink.- Specified by:
counterin 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:MetricGroupRegisters a newGaugewith Flink.- Specified by:
gaugein 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:MetricGroupRegisters a newMeterwith Flink.- Specified by:
meterin 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:MetricGroupRegisters a newHistogramwith Flink.- Specified by:
histogramin 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:MetricGroupCreates a new MetricGroup and adds it to this groups sub-groups.- Specified by:
addGroupin interfaceMetricGroup- Parameters:
name- name of the group- Returns:
- the created group
-
addGroup
public MetricGroup addGroup(String key, String value)
Description copied from interface:MetricGroupCreates 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:
addGroupin 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:MetricGroupGets the scope as an array of the scope components, for example["host-7", "taskmanager-2", "window_word_count", "my-mapper"].- Specified by:
getScopeComponentsin interfaceMetricGroup- See Also:
MetricGroup.getMetricIdentifier(String),MetricGroup.getMetricIdentifier(String, CharacterFilter)
-
getAllVariables
public Map<String,String> getAllVariables()
Description copied from interface:MetricGroupReturns a map of all variables and their associated value, for example{"<host>"="host-7", "<tm_id>"="taskmanager-2"}.- Specified by:
getAllVariablesin interfaceMetricGroup- Returns:
- map of all variables and their associated value
-
getMetricIdentifier
public String getMetricIdentifier(String metricName)
Description copied from interface:MetricGroupReturns the fully qualified metric name, for example"host-7.taskmanager-2.window_word_count.my-mapper.metricName".- Specified by:
getMetricIdentifierin interfaceMetricGroup- Parameters:
metricName- metric name- Returns:
- fully qualified metric name
-
getMetricIdentifier
public String getMetricIdentifier(String metricName, CharacterFilter filter)
Description copied from interface:MetricGroupReturns the fully qualified metric name, for example"host-7.taskmanager-2.window_word_count.my-mapper.metricName".- Specified by:
getMetricIdentifierin 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()
-
-