@Override
    public long getCurrentTime() {
        return deploymentStart == NOT_STARTED
                ? 0L
                : Math.max(0, clock.absoluteTimeMillis() - deploymentStart);
    }
@Test
    void testGetCurrentTime() {
        final ManualClock clock = new ManualClock(Duration.ofMillis(5).toNanos());

        final DeploymentStateTimeMetrics metrics =
                new DeploymentStateTimeMetrics(JobType.BATCH, settings, clock);

        final ExecutionAttemptID id1 = createExecutionAttemptId();
        final ExecutionAttemptID id2 = createExecutionAttemptId();

        metrics.onStateUpdate(id1, ExecutionState.CREATED, ExecutionState.SCHEDULED);
        metrics.onStateUpdate(id1, ExecutionState.SCHEDULED, ExecutionState.DEPLOYING);

        clock.advanceTime(Duration.ofMillis(5));
        assertThat(metrics.getCurrentTime()).isEqualTo(5L);
    }