@Override
    public long getEndToEndDuration() {
        return Math.max(0, failureTimestamp - triggerTimestamp);
    }
@Test
    void testEndToEndDuration() {
        long duration = 123912931293L;
        long triggerTimestamp = 10123;
        long failureTimestamp = triggerTimestamp + duration;

        Map<JobVertexID, TaskStateStats> taskStats = new HashMap<>();
        JobVertexID jobVertexId = new JobVertexID();
        taskStats.put(jobVertexId, new TaskStateStats(jobVertexId, 1));

        FailedCheckpointStats failed =
                new FailedCheckpointStats(
                        0,
                        triggerTimestamp,
                        CheckpointProperties.forCheckpoint(
                                CheckpointRetentionPolicy.NEVER_RETAIN_AFTER_TERMINATION),
                        1,
                        taskStats,
                        0,
                        0,
                        0,
                        0,
                        0,
                        false,
                        failureTimestamp,
                        null,
                        null);

        assertThat(failed.getEndToEndDuration()).isEqualTo(duration);
    }