Class AllSubTasksRunningOrFinishedStateTimeMetrics
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.metrics.AllSubTasksRunningOrFinishedStateTimeMetrics
-
- All Implemented Interfaces:
ExecutionStateUpdateListener,ExecutionStatusMetricsRegistrar,MetricsRegistrar,StateTimeMetric
public class AllSubTasksRunningOrFinishedStateTimeMetrics extends Object implements ExecutionStatusMetricsRegistrar, StateTimeMetric
Metrics and event that captures how long a job has all it's subtask in running or finished state.This is only interesting for streaming jobs, and we don't register for batch.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAllSubTasksRunningOrFinishedStateTimeMetrics.Status
-
Field Summary
Fields Modifier and Type Field Description static StringSTATUS_ATTRIBUTE
-
Constructor Summary
Constructors Constructor Description AllSubTasksRunningOrFinishedStateTimeMetrics(JobType semantic, org.apache.flink.configuration.MetricOptions.JobStatusMetricsSettings stateTimeMetricsSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetBinary()Returns 1 if we are in the targeted state, otherwise 0.longgetCurrentTime()Returns the time, in milliseconds, that have elapsed since we transitioned to the targeted state.longgetTotalTime()Returns the total time, in milliseconds, that we have spent in the targeted state.voidonStateUpdate(ExecutionAttemptID execution, ExecutionState previousState, ExecutionState newState)voidonStateUpdate(Execution execution, ExecutionState previousState, ExecutionState newState)voidregisterMetrics(org.apache.flink.metrics.MetricGroup metricGroup)
-
-
-
Field Detail
-
STATUS_ATTRIBUTE
public static final String STATUS_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AllSubTasksRunningOrFinishedStateTimeMetrics
public AllSubTasksRunningOrFinishedStateTimeMetrics(JobType semantic, org.apache.flink.configuration.MetricOptions.JobStatusMetricsSettings stateTimeMetricsSettings)
-
-
Method Detail
-
getCurrentTime
public long getCurrentTime()
Description copied from interface:StateTimeMetricReturns the time, in milliseconds, that have elapsed since we transitioned to the targeted state. Returns 0 if we are not in the targeted state.- Specified by:
getCurrentTimein interfaceStateTimeMetric
-
getTotalTime
public long getTotalTime()
Description copied from interface:StateTimeMetricReturns the total time, in milliseconds, that we have spent in the targeted state.- Specified by:
getTotalTimein interfaceStateTimeMetric
-
getBinary
public long getBinary()
Description copied from interface:StateTimeMetricReturns 1 if we are in the targeted state, otherwise 0.- Specified by:
getBinaryin interfaceStateTimeMetric
-
registerMetrics
public void registerMetrics(org.apache.flink.metrics.MetricGroup metricGroup)
- Specified by:
registerMetricsin interfaceMetricsRegistrar
-
onStateUpdate
public void onStateUpdate(Execution execution, ExecutionState previousState, ExecutionState newState)
-
onStateUpdate
public void onStateUpdate(ExecutionAttemptID execution, ExecutionState previousState, ExecutionState newState)
- Specified by:
onStateUpdatein interfaceExecutionStateUpdateListener
-
-