Source:
public void shouldGetRecordE2ELatencySensor() { final String operation = "record-e2e-latency"; final String recordE2ELatencyMinDescription = "The minimum end-to-end latency of a record, measuring by comparing the record timestamp with the " + "system time when it has been fully processed by the node"; final String recordE2ELatencyMaxDescription = "The maximum end-to-end latency of a record, measuring by comparing the record timestamp with the " + "system time when it has been fully processed by the node"; final String recordE2ELatencyP99Description = "The 99th percentile end-to-end latency of a record, measuring by comparing the record timestamp with the " + "system time when it has been fully processed by the node"; final String recordE2ELatencyP90Description = "The 90th percentile end-to-end latency of a record, measuring by comparing the record timestamp with the " + "system time when it has been fully processed by the node"; expect(streamsMetrics.nodeLevelSensor(THREAD_ID, TASK_ID, PROCESSOR_NODE_ID, operation, RecordingLevel.INFO)) .andReturn(expectedSensor); expect(streamsMetrics.nodeLevelTagMap(THREAD_ID, TASK_ID, PROCESSOR_NODE_ID)).andReturn(tagMap); StreamsMetricsImpl.addMinAndMaxAndP99AndP90ToSensor( expectedSensor, PROCESSOR_NODE_LEVEL_GROUP, tagMap, operation, recordE2ELatencyMinDescription, recordE2ELatencyMaxDescription, recordE2ELatencyP99Description, recordE2ELatencyP90Description ); replay(StreamsMetricsImpl.class, streamsMetrics); final Sensor sensor = ProcessorNodeMetrics.recordE2ELatencySensor(THREAD_ID, TASK_ID, PROCESSOR_NODE_ID, RecordingLevel.INFO, streamsMetrics); verify(StreamsMetricsImpl.class, streamsMetrics); assertThat(sensor, is(expectedSensor)); }

Target:
public void shouldGetRecordE2ELatencySensor() { final String operation = "record-e2e-latency"; final String recordE2ELatencyMinDescription = "The minimum end-to-end latency of a record, measuring by comparing the record timestamp with the " + "system time when it has been fully processed by the node"; final String recordE2ELatencyMaxDescription = "The maximum end-to-end latency of a record, measuring by comparing the record timestamp with the " + "system time when it has been fully processed by the node"; final String recordE2ELatencyP99Description = "The 99th percentile end-to-end latency of a record, measuring by comparing the record timestamp with the " + "system time when it has been fully processed by the node"; final String recordE2ELatencyP90Description = "The 90th percentile end-to-end latency of a record, measuring by comparing the record timestamp with the " + "system time when it has been fully processed by the node"; expect(streamsMetrics.nodeLevelSensor(THREAD_ID, TASK_ID, PROCESSOR_NODE_ID, operation, RecordingLevel.INFO)) .andReturn(expectedSensor); expect(streamsMetrics.nodeLevelTagMap(THREAD_ID, TASK_ID, PROCESSOR_NODE_ID)).andReturn(tagMap); StreamsMetricsImpl.addMinAndMaxAndP99AndP90ToSensor( expectedSensor, PROCESSOR_NODE_LEVEL_GROUP, tagMap, operation, recordE2ELatencyMinDescription, recordE2ELatencyMaxDescription, recordE2ELatencyP99Description, recordE2ELatencyP90Description ); verifySensor(() -> ProcessorNodeMetrics.recordE2ELatencySensor(THREAD_ID, TASK_ID, PROCESSOR_NODE_ID, RecordingLevel.INFO, streamsMetrics)); }