Class ComponentMetricGroup<P extends AbstractMetricGroup<?>>
java.lang.Object
org.apache.flink.runtime.metrics.groups.AbstractMetricGroup<P>
org.apache.flink.runtime.metrics.groups.ComponentMetricGroup<P>
- Type Parameters:
P- The type of the parent MetricGroup.
- All Implemented Interfaces:
org.apache.flink.metrics.MetricGroup
- Direct Known Subclasses:
InternalOperatorMetricGroup,JobManagerMetricGroup,JobManagerOperatorMetricGroup,JobMetricGroup,TaskManagerMetricGroup,TaskMetricGroup
@Internal
public abstract class ComponentMetricGroup<P extends AbstractMetricGroup<?>>
extends AbstractMetricGroup<P>
Abstract
MetricGroup for system components (e.g., TaskManager,
Job, Task, Operator).
Usually, the scope of metrics is simply the hierarchy of the containing groups. For example
the Metric "MyMetric" in group "B" nested in group "A" would have a fully
scoped name of "A.B.MyMetric", with "A.B" being the Metric's scope.
Component groups, however, have configurable scopes. This allow users to include or exclude certain identifiers from the scope. The scope for metrics belonging to the "Task" group could for example include the task attempt number (more fine grained identification), or exclude it (for continuity of the namespace across failure and recovery).
-
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 -
Constructor Summary
ConstructorsConstructorDescriptionComponentMetricGroup(MetricRegistry registry, String[] scope, P parent) Creates a new ComponentMetricGroup. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the component group by removing and closing all metrics and subgroups (inherited fromAbstractMetricGroup), plus closing and removing all dedicated component subgroups.protected abstract Iterable<? extends ComponentMetricGroup>Gets all component metric groups that are contained in this component metric group.Methods inherited from class org.apache.flink.runtime.metrics.groups.AbstractMetricGroup
addGroup, addGroup, addMetric, addSpan, counter, counter, createChildGroup, createLogicalScope, createQueryServiceMetricInfo, gauge, getAllVariables, getAllVariables, getGroupName, getLogicalScope, getLogicalScope, getMetricIdentifier, getMetricIdentifier, getMetricIdentifier, getQueryServiceMetricInfo, getScopeComponents, histogram, isClosed, meter, putVariablesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.metrics.MetricGroup
addGroup, counter, counter, gauge, histogram, meter
-
Constructor Details
-
ComponentMetricGroup
Creates a new ComponentMetricGroup.- Parameters:
registry- registry to register new metrics withscope- the scope of the group
-
-
Method Details
-
close
public void close()Closes the component group by removing and closing all metrics and subgroups (inherited fromAbstractMetricGroup), plus closing and removing all dedicated component subgroups.- Overrides:
closein classAbstractMetricGroup<P extends AbstractMetricGroup<?>>
-
subComponents
Gets all component metric groups that are contained in this component metric group.- Returns:
- All component metric groups that are contained in this component metric group.
-