public class JobManagerMetricGroup extends ComponentMetricGroup<JobManagerMetricGroup> implements LocallyCleanableResource
MetricGroup
representing a JobManager.
Contains extra logic for adding jobs with tasks, and removing jobs when they do not contain tasks any more
AbstractMetricGroup.ChildType
LOG, parent, queryServiceScopeInfo, registry, variables
Modifier and Type | Method and Description |
---|---|
JobManagerJobMetricGroup |
addJob(JobID jobId,
String jobName) |
static JobManagerMetricGroup |
createJobManagerMetricGroup(MetricRegistry metricRegistry,
String hostname) |
protected QueryScopeInfo.JobManagerQueryScopeInfo |
createQueryServiceMetricInfo(CharacterFilter filter)
Creates the metric query service scope for this group.
|
protected String |
getGroupName(CharacterFilter filter)
Returns the name for this group, meaning what kind of entity it represents, for example
"taskmanager".
|
String |
hostname() |
CompletableFuture<Void> |
localCleanupAsync(JobID jobId,
Executor ignoredExecutor)
localCleanupAsync is expected to be called from the main thread. |
int |
numRegisteredJobMetricGroups() |
protected void |
putVariables(Map<String,String> variables)
Enters all variables specific to this
AbstractMetricGroup 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.
|
close
addGroup, addGroup, addMetric, counter, counter, createChildGroup, createLogicalScope, gauge, getAllVariables, getAllVariables, getLogicalScope, getLogicalScope, getMetricIdentifier, getMetricIdentifier, getMetricIdentifier, getQueryServiceMetricInfo, getScopeComponents, histogram, isClosed, meter
public static JobManagerMetricGroup createJobManagerMetricGroup(MetricRegistry metricRegistry, String hostname)
public String hostname()
protected QueryScopeInfo.JobManagerQueryScopeInfo createQueryServiceMetricInfo(CharacterFilter filter)
AbstractMetricGroup
createQueryServiceMetricInfo
in class AbstractMetricGroup<JobManagerMetricGroup>
filter
- character filterpublic JobManagerJobMetricGroup addJob(JobID jobId, String jobName)
public CompletableFuture<Void> localCleanupAsync(JobID jobId, Executor ignoredExecutor)
LocallyCleanableResource
localCleanupAsync
is expected to be called from the main thread. Heavy IO tasks
should be outsourced into the passed cleanupExecutor
. Thread-safety must be ensured.localCleanupAsync
in interface LocallyCleanableResource
jobId
- The JobID
of the job for which the local data should be cleaned up.ignoredExecutor
- The fallback executor for IO-heavy operations.public int numRegisteredJobMetricGroups()
protected void putVariables(Map<String,String> variables)
AbstractMetricGroup
AbstractMetricGroup
and their associated values
into the map.putVariables
in class AbstractMetricGroup<JobManagerMetricGroup>
variables
- map to enter variables and their values intoprotected Iterable<? extends ComponentMetricGroup> subComponents()
ComponentMetricGroup
subComponents
in class ComponentMetricGroup<JobManagerMetricGroup>
protected String getGroupName(CharacterFilter filter)
AbstractMetricGroup
getGroupName
in class AbstractMetricGroup<JobManagerMetricGroup>
filter
- character filter which is applied to the nameCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.