Class TaskManagerMetricGroup
- java.lang.Object
-
- org.apache.flink.runtime.metrics.groups.AbstractMetricGroup<P>
-
- org.apache.flink.runtime.metrics.groups.ComponentMetricGroup<TaskManagerMetricGroup>
-
- org.apache.flink.runtime.metrics.groups.TaskManagerMetricGroup
-
- All Implemented Interfaces:
org.apache.flink.metrics.MetricGroup
- Direct Known Subclasses:
UnregisteredMetricGroups.UnregisteredTaskManagerMetricGroup
@Internal public class TaskManagerMetricGroup extends ComponentMetricGroup<TaskManagerMetricGroup>
SpecialMetricGrouprepresenting a TaskManager.Contains extra logic for adding jobs with tasks, and removing jobs when they do not contain tasks any more
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.metrics.groups.AbstractMetricGroup
AbstractMetricGroup.ChildType
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.metrics.groups.AbstractMetricGroup
LOG, parent, queryServiceScopeInfo, registry, variables
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskManagerJobMetricGroupaddJob(org.apache.flink.api.common.JobID jobId, String jobName)protected QueryScopeInfo.TaskManagerQueryScopeInfocreateQueryServiceMetricInfo(org.apache.flink.metrics.CharacterFilter filter)Creates the metric query service scope for this group.static TaskManagerMetricGroupcreateTaskManagerMetricGroup(MetricRegistry metricRegistry, String hostName, ResourceID resourceID)protected StringgetGroupName(org.apache.flink.metrics.CharacterFilter filter)Returns the name for this group, meaning what kind of entity it represents, for example "taskmanager".TaskManagerJobMetricGroupgetJobMetricsGroup(org.apache.flink.api.common.JobID jobId)Stringhostname()intnumRegisteredJobMetricGroups()protected voidputVariables(Map<String,String> variables)Enters all variables specific to thisAbstractMetricGroupand their associated values into the map.voidremoveJobMetricsGroup(org.apache.flink.api.common.JobID jobId)protected Iterable<? extends ComponentMetricGroup>subComponents()Gets all component metric groups that are contained in this component metric group.StringtaskManagerId()-
Methods inherited from class org.apache.flink.runtime.metrics.groups.ComponentMetricGroup
close
-
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
-
-
-
-
Method Detail
-
createTaskManagerMetricGroup
public static TaskManagerMetricGroup createTaskManagerMetricGroup(MetricRegistry metricRegistry, String hostName, ResourceID resourceID)
-
hostname
public String hostname()
-
taskManagerId
public String taskManagerId()
-
createQueryServiceMetricInfo
protected QueryScopeInfo.TaskManagerQueryScopeInfo createQueryServiceMetricInfo(org.apache.flink.metrics.CharacterFilter filter)
Description copied from class:AbstractMetricGroupCreates the metric query service scope for this group.- Specified by:
createQueryServiceMetricInfoin classAbstractMetricGroup<TaskManagerMetricGroup>- Parameters:
filter- character filter- Returns:
- query service scope
-
addJob
public TaskManagerJobMetricGroup addJob(org.apache.flink.api.common.JobID jobId, String jobName)
-
getJobMetricsGroup
@VisibleForTesting public TaskManagerJobMetricGroup getJobMetricsGroup(org.apache.flink.api.common.JobID jobId)
-
removeJobMetricsGroup
public void removeJobMetricsGroup(org.apache.flink.api.common.JobID jobId)
-
numRegisteredJobMetricGroups
public int numRegisteredJobMetricGroups()
-
putVariables
protected void putVariables(Map<String,String> variables)
Description copied from class:AbstractMetricGroupEnters all variables specific to thisAbstractMetricGroupand their associated values into the map.- Overrides:
putVariablesin classAbstractMetricGroup<TaskManagerMetricGroup>- Parameters:
variables- map to enter variables and their values into
-
subComponents
protected Iterable<? extends ComponentMetricGroup> subComponents()
Description copied from class:ComponentMetricGroupGets all component metric groups that are contained in this component metric group.- Specified by:
subComponentsin classComponentMetricGroup<TaskManagerMetricGroup>- Returns:
- All component metric groups that are contained in this component metric group.
-
getGroupName
protected String getGroupName(org.apache.flink.metrics.CharacterFilter filter)
Description copied from class:AbstractMetricGroupReturns the name for this group, meaning what kind of entity it represents, for example "taskmanager".- Specified by:
getGroupNamein classAbstractMetricGroup<TaskManagerMetricGroup>- Parameters:
filter- character filter which is applied to the name- Returns:
- logical name for this group
-
-