Class TaskMetricGroup
- java.lang.Object
-
- org.apache.flink.runtime.metrics.groups.AbstractMetricGroup<P>
-
- org.apache.flink.runtime.metrics.groups.ComponentMetricGroup<TaskManagerJobMetricGroup>
-
- org.apache.flink.runtime.metrics.groups.TaskMetricGroup
-
- All Implemented Interfaces:
MetricGroup
- Direct Known Subclasses:
UnregisteredMetricGroups.UnregisteredTaskMetricGroup
@Internal public class TaskMetricGroup extends ComponentMetricGroup<TaskManagerJobMetricGroup>
SpecialMetricGroup
representing a Flink runtime Task.Contains extra logic for adding operators.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.metrics.groups.AbstractMetricGroup
AbstractMetricGroup.ChildType
-
-
Field Summary
Fields Modifier and Type Field Description protected int
subtaskIndex
protected JobVertexID
vertexId
-
Fields inherited from class org.apache.flink.runtime.metrics.groups.AbstractMetricGroup
LOG, parent, queryServiceScopeInfo, registry, variables
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
attemptNumber()
void
close()
Closes the component group by removing and closing all metrics and subgroups (inherited fromAbstractMetricGroup
), plus closing and removing all dedicated component subgroups.protected QueryScopeInfo.TaskQueryScopeInfo
createQueryServiceMetricInfo(CharacterFilter filter)
Creates the metric query service scope for this group.ExecutionAttemptID
executionId()
protected String
getGroupName(CharacterFilter filter)
Returns the name for this group, meaning what kind of entity it represents, for example "taskmanager".TaskIOMetricGroup
getIOMetricGroup()
Returns the TaskIOMetricGroup for this task.InternalOperatorMetricGroup
getOrAddOperator(String operatorName)
InternalOperatorMetricGroup
getOrAddOperator(OperatorID operatorID, String operatorName)
TaskManagerJobMetricGroup
parent()
protected void
putVariables(Map<String,String> variables)
Enters all variables specific to thisAbstractMetricGroup
and their associated values into the map.protected Iterable<? extends ComponentMetricGroup>
subComponents()
Gets all component metric groups that are contained in this component metric group.int
subtaskIndex()
String
taskName()
AbstractID
vertexId()
-
Methods inherited from class org.apache.flink.runtime.metrics.groups.AbstractMetricGroup
addGroup, addGroup, addMetric, addSpan, counter, counter, createChildGroup, createLogicalScope, gauge, getAllVariables, getAllVariables, getLogicalScope, getLogicalScope, getMetricIdentifier, getMetricIdentifier, getMetricIdentifier, getQueryServiceMetricInfo, getScopeComponents, histogram, isClosed, meter
-
-
-
-
Field Detail
-
vertexId
protected final JobVertexID vertexId
-
subtaskIndex
protected final int subtaskIndex
-
-
Method Detail
-
parent
public final TaskManagerJobMetricGroup parent()
-
executionId
public ExecutionAttemptID executionId()
-
vertexId
@Nullable public AbstractID vertexId()
-
taskName
@Nullable public String taskName()
-
subtaskIndex
public int subtaskIndex()
-
attemptNumber
public int attemptNumber()
-
getIOMetricGroup
public TaskIOMetricGroup getIOMetricGroup()
Returns the TaskIOMetricGroup for this task.- Returns:
- TaskIOMetricGroup for this task.
-
createQueryServiceMetricInfo
protected QueryScopeInfo.TaskQueryScopeInfo createQueryServiceMetricInfo(CharacterFilter filter)
Description copied from class:AbstractMetricGroup
Creates the metric query service scope for this group.- Specified by:
createQueryServiceMetricInfo
in classAbstractMetricGroup<TaskManagerJobMetricGroup>
- Parameters:
filter
- character filter- Returns:
- query service scope
-
getOrAddOperator
public InternalOperatorMetricGroup getOrAddOperator(String operatorName)
-
getOrAddOperator
public InternalOperatorMetricGroup getOrAddOperator(OperatorID operatorID, String operatorName)
-
close
public void close()
Description copied from class:ComponentMetricGroup
Closes the component group by removing and closing all metrics and subgroups (inherited fromAbstractMetricGroup
), plus closing and removing all dedicated component subgroups.- Overrides:
close
in classComponentMetricGroup<TaskManagerJobMetricGroup>
-
putVariables
protected void putVariables(Map<String,String> variables)
Description copied from class:AbstractMetricGroup
Enters all variables specific to thisAbstractMetricGroup
and their associated values into the map.- Overrides:
putVariables
in classAbstractMetricGroup<TaskManagerJobMetricGroup>
- Parameters:
variables
- map to enter variables and their values into
-
subComponents
protected Iterable<? extends ComponentMetricGroup> subComponents()
Description copied from class:ComponentMetricGroup
Gets all component metric groups that are contained in this component metric group.- Specified by:
subComponents
in classComponentMetricGroup<TaskManagerJobMetricGroup>
- Returns:
- All component metric groups that are contained in this component metric group.
-
getGroupName
protected String getGroupName(CharacterFilter filter)
Description copied from class:AbstractMetricGroup
Returns the name for this group, meaning what kind of entity it represents, for example "taskmanager".- Specified by:
getGroupName
in classAbstractMetricGroup<TaskManagerJobMetricGroup>
- Parameters:
filter
- character filter which is applied to the name- Returns:
- logical name for this group
-
-