Java Code Examples for org.apache.flink.runtime.checkpoint.TaskStateStats#TaskStateStatsSummary

The following examples show how to use org.apache.flink.runtime.checkpoint.TaskStateStats#TaskStateStatsSummary . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskCheckpointStatisticDetailsHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
private static TaskCheckpointStatisticsWithSubtaskDetails.Summary createSummary(TaskStateStats.TaskStateStatsSummary taskStatisticsSummary, long triggerTimestamp) {
	final MinMaxAvgStats stateSizeStats = taskStatisticsSummary.getStateSizeStats();
	final MinMaxAvgStats ackTSStats = taskStatisticsSummary.getAckTimestampStats();
	final MinMaxAvgStats syncDurationStats = taskStatisticsSummary.getSyncCheckpointDurationStats();
	final MinMaxAvgStats asyncDurationStats = taskStatisticsSummary.getAsyncCheckpointDurationStats();

	final TaskCheckpointStatisticsWithSubtaskDetails.CheckpointDuration checkpointDuration = new TaskCheckpointStatisticsWithSubtaskDetails.CheckpointDuration(
		new MinMaxAvgStatistics(syncDurationStats.getMinimum(), syncDurationStats.getMaximum(), syncDurationStats.getAverage()),
		new MinMaxAvgStatistics(asyncDurationStats.getMinimum(), asyncDurationStats.getMaximum(), asyncDurationStats.getAverage()));

	final MinMaxAvgStats alignmentBufferedStats = taskStatisticsSummary.getAlignmentBufferedStats();
	final MinMaxAvgStats alignmentDurationStats = taskStatisticsSummary.getAlignmentDurationStats();

	final TaskCheckpointStatisticsWithSubtaskDetails.CheckpointAlignment checkpointAlignment = new TaskCheckpointStatisticsWithSubtaskDetails.CheckpointAlignment(
		new MinMaxAvgStatistics(alignmentBufferedStats.getMinimum(), alignmentBufferedStats.getMaximum(), alignmentBufferedStats.getAverage()),
		new MinMaxAvgStatistics(alignmentDurationStats.getMinimum(), alignmentDurationStats.getMaximum(), alignmentDurationStats.getAverage()));

	return new TaskCheckpointStatisticsWithSubtaskDetails.Summary(
		new MinMaxAvgStatistics(stateSizeStats.getMinimum(), stateSizeStats.getMaximum(), stateSizeStats.getAverage()),
		new MinMaxAvgStatistics(
			Math.max(0L, ackTSStats.getMinimum() - triggerTimestamp),
			Math.max(0L, ackTSStats.getMaximum() - triggerTimestamp),
			Math.max(0L, ackTSStats.getAverage() - triggerTimestamp)),
		checkpointDuration,
		checkpointAlignment);
}
 
Example 2
Source File: TaskCheckpointStatisticDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
private static TaskCheckpointStatisticsWithSubtaskDetails.Summary createSummary(TaskStateStats.TaskStateStatsSummary taskStatisticsSummary, long triggerTimestamp) {
	final MinMaxAvgStats stateSizeStats = taskStatisticsSummary.getStateSizeStats();
	final MinMaxAvgStats ackTSStats = taskStatisticsSummary.getAckTimestampStats();
	final MinMaxAvgStats syncDurationStats = taskStatisticsSummary.getSyncCheckpointDurationStats();
	final MinMaxAvgStats asyncDurationStats = taskStatisticsSummary.getAsyncCheckpointDurationStats();

	final TaskCheckpointStatisticsWithSubtaskDetails.CheckpointDuration checkpointDuration = new TaskCheckpointStatisticsWithSubtaskDetails.CheckpointDuration(
		new MinMaxAvgStatistics(syncDurationStats.getMinimum(), syncDurationStats.getMaximum(), syncDurationStats.getAverage()),
		new MinMaxAvgStatistics(asyncDurationStats.getMinimum(), asyncDurationStats.getMaximum(), asyncDurationStats.getAverage()));

	final MinMaxAvgStats alignmentBufferedStats = taskStatisticsSummary.getAlignmentBufferedStats();
	final MinMaxAvgStats alignmentDurationStats = taskStatisticsSummary.getAlignmentDurationStats();

	final TaskCheckpointStatisticsWithSubtaskDetails.CheckpointAlignment checkpointAlignment = new TaskCheckpointStatisticsWithSubtaskDetails.CheckpointAlignment(
		new MinMaxAvgStatistics(alignmentBufferedStats.getMinimum(), alignmentBufferedStats.getMaximum(), alignmentBufferedStats.getAverage()),
		new MinMaxAvgStatistics(alignmentDurationStats.getMinimum(), alignmentDurationStats.getMaximum(), alignmentDurationStats.getAverage()));

	return new TaskCheckpointStatisticsWithSubtaskDetails.Summary(
		new MinMaxAvgStatistics(stateSizeStats.getMinimum(), stateSizeStats.getMaximum(), stateSizeStats.getAverage()),
		new MinMaxAvgStatistics(
			Math.max(0L, ackTSStats.getMinimum() - triggerTimestamp),
			Math.max(0L, ackTSStats.getMaximum() - triggerTimestamp),
			Math.max(0L, ackTSStats.getAverage() - triggerTimestamp)),
		checkpointDuration,
		checkpointAlignment);
}
 
Example 3
Source File: TaskCheckpointStatisticDetailsHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
private static TaskCheckpointStatisticsWithSubtaskDetails.Summary createSummary(TaskStateStats.TaskStateStatsSummary taskStatisticsSummary, long triggerTimestamp) {
	final MinMaxAvgStats ackTSStats = taskStatisticsSummary.getAckTimestampStats();

	final TaskCheckpointStatisticsWithSubtaskDetails.CheckpointDuration checkpointDuration = new TaskCheckpointStatisticsWithSubtaskDetails.CheckpointDuration(
		MinMaxAvgStatistics.valueOf(taskStatisticsSummary.getSyncCheckpointDurationStats()),
		MinMaxAvgStatistics.valueOf(taskStatisticsSummary.getAsyncCheckpointDurationStats()));

	final TaskCheckpointStatisticsWithSubtaskDetails.CheckpointAlignment checkpointAlignment = new TaskCheckpointStatisticsWithSubtaskDetails.CheckpointAlignment(
		new MinMaxAvgStatistics(0, 0, 0),
		MinMaxAvgStatistics.valueOf(taskStatisticsSummary.getAlignmentDurationStats()));

	return new TaskCheckpointStatisticsWithSubtaskDetails.Summary(
		MinMaxAvgStatistics.valueOf(taskStatisticsSummary.getStateSizeStats()),
		new MinMaxAvgStatistics(
			Math.max(0L, ackTSStats.getMinimum() - triggerTimestamp),
			Math.max(0L, ackTSStats.getMaximum() - triggerTimestamp),
			Math.max(0L, ackTSStats.getAverage() - triggerTimestamp)),
		checkpointDuration,
		checkpointAlignment,
		MinMaxAvgStatistics.valueOf(taskStatisticsSummary.getCheckpointStartDelayStats()));
}