use of io.confluent.ksql.metrics.ConsumerCollector in project ksql by confluentinc.
the class KsqlEngineMetricsTest method consumeMessages.
private void consumeMessages(int numMessages, String groupId) {
ConsumerCollector collector1 = new ConsumerCollector();
collector1.configure(ImmutableMap.of(ConsumerConfig.GROUP_ID_CONFIG, groupId));
Map<TopicPartition, List<ConsumerRecord<Object, Object>>> records = new HashMap<>();
List<ConsumerRecord<Object, Object>> recordList = new ArrayList<>();
for (int i = 0; i < numMessages; i++) {
recordList.add(new ConsumerRecord<>("foo", 1, 1, 1l, TimestampType.CREATE_TIME, 1l, 10, 10, "key", "1234567890"));
}
records.put(new TopicPartition("foo", 1), recordList);
ConsumerRecords<Object, Object> consumerRecords = new ConsumerRecords<>(records);
collector1.onConsume(consumerRecords);
}
Aggregations