P
- The type of the parent MetricGroup.@Internal public abstract class ComponentMetricGroup<P extends AbstractMetricGroup<?>> extends AbstractMetricGroup<P>
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).
LOG, parent, queryServiceScopeInfo, registry, variables
Constructor and Description |
---|
ComponentMetricGroup(MetricRegistry registry,
String[] scope,
P parent)
Creates a new ComponentMetricGroup.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the component group by removing and closing all metrics and subgroups
(inherited from
AbstractMetricGroup ), plus closing and removing all dedicated
component subgroups. |
Map<String,String> |
getAllVariables()
Returns a map of all variables and their associated value, for example
{"<host>"="host-7", "<tm_id>"="taskmanager-2"} . |
protected abstract void |
putVariables(Map<String,String> variables)
Enters all variables specific to this ComponentMetricGroup and their associated values into the map.
|
protected abstract Iterable<? extends ComponentMetricGroup> |
subComponents()
Gets all component metric groups that are contained in this component metric group.
|
addGroup, addGroup, addMetric, counter, counter, counter, counter, createQueryServiceMetricInfo, gauge, gauge, getGroupName, getLogicalScope, getLogicalScope, getMetricIdentifier, getMetricIdentifier, getMetricIdentifier, getQueryServiceMetricInfo, getScopeComponents, histogram, histogram, isClosed, meter, meter
public ComponentMetricGroup(MetricRegistry registry, String[] scope, P parent)
registry
- registry to register new metrics withscope
- the scope of the grouppublic Map<String,String> getAllVariables()
MetricGroup
{"<host>"="host-7", "<tm_id>"="taskmanager-2"}
.getAllVariables
in interface MetricGroup
getAllVariables
in class AbstractMetricGroup<P extends AbstractMetricGroup<?>>
protected abstract void putVariables(Map<String,String> variables)
variables
- map to enter variables and their values intopublic void close()
AbstractMetricGroup
), plus closing and removing all dedicated
component subgroups.close
in class AbstractMetricGroup<P extends AbstractMetricGroup<?>>
protected abstract Iterable<? extends ComponentMetricGroup> subComponents()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.