Class DeploymentStateTimeMetrics
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.metrics.DeploymentStateTimeMetrics
-
- All Implemented Interfaces:
ExecutionStateUpdateListener
,MetricsRegistrar
,StateTimeMetric
public class DeploymentStateTimeMetrics extends Object implements ExecutionStateUpdateListener, StateTimeMetric, MetricsRegistrar
Metrics that capture how long a job was deploying tasks.These metrics differentiate between batch & streaming use-cases:
Batch: Measures from the start of the first deployment until the first task has been deployed. From that point the job is making progress.
Streaming: Measures from the start of the first deployment until all tasks have been deployed. From that point on checkpoints can be triggered, and thus progress be made.
-
-
Constructor Summary
Constructors Constructor Description DeploymentStateTimeMetrics(JobType semantic, org.apache.flink.configuration.MetricOptions.JobStatusMetricsSettings stateTimeMetricsSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getBinary()
Returns 1 if we are in the targeted state, otherwise 0.long
getCurrentTime()
Returns the time, in milliseconds, that have elapsed since we transitioned to the targeted state.long
getTotalTime()
Returns the total time, in milliseconds, that we have spent in the targeted state.void
onStateUpdate(ExecutionAttemptID execution, ExecutionState previousState, ExecutionState newState)
void
registerMetrics(org.apache.flink.metrics.MetricGroup metricGroup)
-
-
-
Constructor Detail
-
DeploymentStateTimeMetrics
public DeploymentStateTimeMetrics(JobType semantic, org.apache.flink.configuration.MetricOptions.JobStatusMetricsSettings stateTimeMetricsSettings)
-
-
Method Detail
-
getCurrentTime
public long getCurrentTime()
Description copied from interface:StateTimeMetric
Returns 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:
getCurrentTime
in interfaceStateTimeMetric
-
getTotalTime
public long getTotalTime()
Description copied from interface:StateTimeMetric
Returns the total time, in milliseconds, that we have spent in the targeted state.- Specified by:
getTotalTime
in interfaceStateTimeMetric
-
getBinary
public long getBinary()
Description copied from interface:StateTimeMetric
Returns 1 if we are in the targeted state, otherwise 0.- Specified by:
getBinary
in interfaceStateTimeMetric
-
registerMetrics
public void registerMetrics(org.apache.flink.metrics.MetricGroup metricGroup)
- Specified by:
registerMetrics
in interfaceMetricsRegistrar
-
onStateUpdate
public void onStateUpdate(ExecutionAttemptID execution, ExecutionState previousState, ExecutionState newState)
- Specified by:
onStateUpdate
in interfaceExecutionStateUpdateListener
-
-