JingGe commented on a change in pull request #19084:
URL: https://github.com/apache/flink/pull/19084#discussion_r827838830



##########
File path: 
flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/connector/elasticsearch/sink/ElasticsearchWriterITCase.java
##########
@@ -204,6 +205,28 @@ void testIncrementByteOutMetric() throws Exception {
         }
     }
 
+    @Test
+    void testIncrementRecordsSendMetric() throws Exception {
+        final String index = "test-inc-records-send";
+        final int flushAfterNActions = 2;
+        final BulkProcessorConfig bulkProcessorConfig =
+                new BulkProcessorConfig(flushAfterNActions, -1, -1, 
FlushBackoffType.NONE, 0, 0);
+
+        try (final ElasticsearchWriter<Tuple2<Integer, String>> writer =
+                createWriter(index, false, bulkProcessorConfig)) {
+            final Optional<Counter> recordsSend =
+                    metricListener.getCounter(MetricNames.NUM_RECORDS_SEND);
+            writer.write(Tuple2.of(1, buildMessage(1)), null);
+            writer.write(Tuple2.of(2, buildMessage(2)), null);
+            writer.write(Tuple2.of(2, buildMessage(3)), null);

Review comment:
       Could these three write calls test the three add(...) methods, i.e. 
DeleteRequest, IndexRequest, UpdateRequest




-- 
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]


Reply via email to