dannycranmer commented on a change in pull request #15157:
URL: https://github.com/apache/flink/pull/15157#discussion_r599643750
##########
File path:
flink-connectors/flink-connector-kinesis/src/test/java/org/apache/flink/streaming/connectors/kinesis/internals/publisher/polling/PollingRecordPublisherTest.java
##########
@@ -58,6 +61,21 @@ public void testRunPublishesRecordsToConsumer() throws
Exception {
assertEquals(100L,
consumer.getRecordBatches().get(0).getMillisBehindLatest(), 0);
}
+ @Test
+ public void testRunEmitsRunLoopTimeNanos() throws Exception {
+ PollingRecordPublisherMetricsReporter metricsReporter =
+ spy(new
PollingRecordPublisherMetricsReporter(mock(MetricGroup.class)));
+
+ KinesisProxyInterface fakeKinesis =
totalNumOfRecordsAfterNumOfGetRecordsCalls(5, 5, 100);
+ PollingRecordPublisher recordPublisher =
+ createPollingRecordPublisher(fakeKinesis, metricsReporter);
+
+ recordPublisher.run(new TestConsumer());
+
+ // Expect that the run loop took at least FETCH_INTERVAL_MILLIS in
nanos
+ verify(metricsReporter).setRunLoopTimeNanos(gt(FETCH_INTERVAL_MILLIS *
1000));
Review comment:
Good catch!
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]