Fix Kafka Streams skipped-records-rate sensor bug
Fix as described in the Jira comment](https://issues.apache.org/jira/browse/KAFKA-5055?focusedCommentId=15990086&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15990086).
mjsax guozhangwang take a look
Author: dpoldrugo
Reviewers: Matthias J. Sax, Guozhang Wang
Closes from dpoldrugo/KAFKA-5055-skipped-records-rate-sensor-bug
@@ -380,7 +380,7 @@ public class StreamTask extends AbstractTask implements Punctuator {
*/
@SuppressWarnings("unchecked")
public int addRecords(final TopicPartition partition, final Iterable<ConsumerRecord<byte[], byte[]>> records) {
- final int oldQueueSize = partitionGroup.numBuffered();
+ final int oldQueueSize = partitionGroup.numBuffered(partition);
final int newQueueSize = partitionGroup.addRawRecords(partition, records);
log.trace("{} Added records into the buffered queue of partition {}, new queue size is {}", logPrefix, partition, newQueueSize);
