Class FrontMetricGroup<P extends AbstractMetricGroup<?>>
- java.lang.Object
-
- org.apache.flink.runtime.metrics.groups.ProxyMetricGroup<P>
-
- org.apache.flink.runtime.metrics.groups.FrontMetricGroup<P>
-
- Type Parameters:
P
- parentMetricGroup toAbstractMetricGroup
- All Implemented Interfaces:
LogicalScopeProvider
,MetricGroup
public class FrontMetricGroup<P extends AbstractMetricGroup<?>> extends ProxyMetricGroup<P> implements LogicalScopeProvider
Metric group which forwards all registration calls to a variable parent metric group that injects a variable reporter index into calls toMetricGroup.getMetricIdentifier(String)
orMetricGroup.getMetricIdentifier(String, CharacterFilter)
. This allows us to use reporter-specific delimiters, without requiring any action by the reporter.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.metrics.groups.ProxyMetricGroup
parentMetricGroup
-
-
Constructor Summary
Constructors Constructor Description FrontMetricGroup(ReporterScopedSettings settings, P reference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getAllVariables()
Returns a map of all variables and their associated value, for example{"<host>"="host-7", "<tm_id>"="taskmanager-2"}
.String
getLogicalScope(CharacterFilter filter)
Returns the logical scope for the metric group, for example"taskmanager.job.task"
, with the given filter being applied to all scope components.String
getLogicalScope(CharacterFilter filter, char delimiter)
Returns the logical scope for the metric group, for example"taskmanager.job.task"
, with the given filter being applied to all scope components and the given delimiter being used to concatenate scope components.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"
.MetricGroup
getWrappedMetricGroup()
Returns the underlying metric group.-
Methods inherited from class org.apache.flink.runtime.metrics.groups.ProxyMetricGroup
addGroup, addGroup, addSpan, counter, counter, gauge, getScopeComponents, histogram, meter
-
-
-
-
Constructor Detail
-
FrontMetricGroup
public FrontMetricGroup(ReporterScopedSettings settings, P reference)
-
-
Method Detail
-
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
- Overrides:
getMetricIdentifier
in classProxyMetricGroup<P extends AbstractMetricGroup<?>>
- 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
- Overrides:
getMetricIdentifier
in classProxyMetricGroup<P extends AbstractMetricGroup<?>>
- Parameters:
metricName
- metric namefilter
- character filter which is applied to the scope components if not null.- Returns:
- fully qualified metric name
-
getWrappedMetricGroup
public MetricGroup getWrappedMetricGroup()
Description copied from interface:LogicalScopeProvider
Returns the underlying metric group.- Specified by:
getWrappedMetricGroup
in interfaceLogicalScopeProvider
-
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
- Overrides:
getAllVariables
in classProxyMetricGroup<P extends AbstractMetricGroup<?>>
- Returns:
- map of all variables and their associated value
-
getLogicalScope
public String getLogicalScope(CharacterFilter filter)
Description copied from interface:LogicalScopeProvider
Returns the logical scope for the metric group, for example"taskmanager.job.task"
, with the given filter being applied to all scope components.- Specified by:
getLogicalScope
in interfaceLogicalScopeProvider
- Parameters:
filter
- filter to apply to all scope components- Returns:
- logical scope
-
getLogicalScope
public String getLogicalScope(CharacterFilter filter, char delimiter)
Description copied from interface:LogicalScopeProvider
Returns the logical scope for the metric group, for example"taskmanager.job.task"
, with the given filter being applied to all scope components and the given delimiter being used to concatenate scope components.- Specified by:
getLogicalScope
in interfaceLogicalScopeProvider
- Parameters:
filter
- filter to apply to all scope componentsdelimiter
- delimiter to use for concatenating scope components- Returns:
- logical scope
-
-