RocMarshal commented on code in PR #26985:
URL: https://github.com/apache/flink/pull/26985#discussion_r2362108422
##########
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/DefaultCheckpointStatsTrackerTest.java:
##########
@@ -434,6 +437,254 @@ private void assertCheckpointAttributes(
assertThat(attributes.get("isUnaligned")).isEqualTo(Boolean.toString(isUnaligned));
}
+ @Test
+ public void testSpanCreationBreakDownPerCheckpoint() {
+
testSpanCreationTemplate(TraceOptions.CheckpointSpanDetailLevel.SPAN_PER_CHECKPOINT);
+ }
+
+ @Test
+ public void testSpanCreationBreakDownPerCheckpointWithTasks() {
+ testSpanCreationTemplate(
+
TraceOptions.CheckpointSpanDetailLevel.SPAN_PER_CHECKPOINT_WITH_TASKS);
+ }
+
+ @Test
+ public void testSpanCreationBreakDownPerTask() {
+
testSpanCreationTemplate(TraceOptions.CheckpointSpanDetailLevel.CHILDREN_SPANS_PER_TASK);
+ }
+
+ @Test
+ public void testSpanCreationBreakDownPerSubTask() {
+
testSpanCreationTemplate(TraceOptions.CheckpointSpanDetailLevel.CHILDREN_SPANS_PER_SUBTASK);
+ }
+
+ public void
testSpanCreationTemplate(TraceOptions.CheckpointSpanDetailLevel detailLevel) {
+ JobVertexID jobVertexID0 = new JobVertexID();
+ JobVertexID jobVertexID1 = new JobVertexID();
+
+ final List<Span> reportedSpans = new ArrayList<>();
+ final List<Event> reportedEvents = new ArrayList<>();
+
+ produceTestSpans(jobVertexID0, jobVertexID1, detailLevel,
reportedSpans, reportedEvents);
+ assertThat(reportedSpans.size()).isEqualTo(1);
+ assertThat(reportedEvents.size()).isEqualTo(1);
+
+ Map<String, Object> expected = new HashMap<>();
+ expected.put("checkpointId", 42L);
Review Comment:
Thanks.
> Could this constants be extracted as immutable strings?
Just a trivial comment. Please ignore it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]