JdbcConsumerManager implements ConsumerManager { @Override public void acknowledgeOffset(String consumer, long offset, boolean useAcknowledgeRate) { if (useAcknowledgeRate) { count++; if (count == acknowledgeRate) { count = 0; updateAcknowledgment(consumer, offset); } } else { updateAcknowledgment(consumer, offset); } } JdbcConsumerManager(Path path);  JdbcConsumerManager(Path path, long acknowledgeRate); @Override long getOffset(String consumer); @Override void acknowledgeOffset(String consumer, long offset, boolean useAcknowledgeRate); @Override @SuppressWarnings("squid:S1166") // Do not log SQL Exception void close(); final long acknowledgeRate; }
@Test @Ignore public void checkPerformance() { JdbcConsumerManager manager = createJdbcConsumerManager(); long start = System.currentTimeMillis(); for (int i = 1; i <= 100; i++) { manager.acknowledgeOffset("Julian", i, true); } long stop = System.currentTimeMillis(); long durationMs = stop - start; assertTrue("Duration was too long, was " + durationMs, durationMs < 1_000); }