Skip to content

Commit 24cf709

Browse files
chore: remove the avg number of batch calculation
1 parent 92477c0 commit 24cf709

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

publisher/kafka.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,22 +181,11 @@ func (pr *Kafka) reportBatchMetrics(stats map[string]interface{}) {
181181
batchSizeAvg = getFloat(bs, "avg")
182182
}
183183

184-
// Average messages per batch
185-
msgsPerBatch := 0.0
186-
if batchCnt > 0 {
187-
msgsPerBatch = msgCnt / batchCnt
188-
}
189-
190184
// Emit metrics
191185
metrics.Gauge("kafka_producer_batch_count_total", int(batchCnt), fmt.Sprintf("topic=%s", topicName))
192186
metrics.Gauge("kafka_producer_message_count_total", int(msgCnt), fmt.Sprintf("topic=%s", topicName))
193187
metrics.Gauge("kafka_producer_batch_size_avg_bytes", batchSizeAvg, fmt.Sprintf("topic=%s", topicName))
194-
metrics.Gauge("kafka_producer_messages_per_batch_avg", msgsPerBatch, fmt.Sprintf("topic=%s", topicName))
195188

196-
logger.Debugf(
197-
"Kafka topic=%s batchSizeAvg=%.2f msgsPerBatch=%.2f batchCnt=%.0f msgCnt=%.0f",
198-
topicName, batchSizeAvg, msgsPerBatch, batchCnt, msgCnt,
199-
)
200189
}
201190
}
202191

0 commit comments

Comments
 (0)