From 9c8501f5f0d4c1f8f4928ea98c889954f0e06cf8 Mon Sep 17 00:00:00 2001 From: John Roesler Date: Thu, 3 Sep 2020 14:18:45 -0500 Subject: [PATCH] MINOR: Record all poll invocations (#9234) Record the pollSensor after every invocation to poll, rather than just when we get records back so that we can accurately gauge how often we're invoking Consumer#poll. Reviewers: Bruno Cadonna , Guozhang Wang , Matthias J. Sax --- .../apache/kafka/streams/processor/internals/StreamThread.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java index 2c39e1f126f..547458c44e5 100644 --- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java +++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java @@ -636,8 +636,8 @@ public class StreamThread extends Thread { final long pollLatency = advanceNowAndComputeLatency(); + pollSensor.record(pollLatency, now); if (records != null && !records.isEmpty()) { - pollSensor.record(pollLatency, now); pollRecordsSensor.record(records.count(), now); taskManager.addRecordsToTasks(records); }