Skip to content

Commit ec0891b

Browse files
committed
Fixed current batch metric to effectively show the current value and not the last value
1 parent cc22aa2 commit ec0891b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

logstash-core/src/main/java/org/logstash/execution/QueueReadClientBatchMetrics.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ public void setupMetrics(AbstractNamespacedMetricExt namespacedMetric) {
4343
}
4444

4545
public void updateBatchMetrics(QueueBatch batch) {
46-
if (batch.events().isEmpty()) {
47-
// avoid to increment batch count for empty batches
46+
if (batchMetricMode == QueueFactoryExt.BatchMetricMode.DISABLED) {
4847
return;
4948
}
5049

51-
if (batchMetricMode == QueueFactoryExt.BatchMetricMode.DISABLED) {
50+
if (batch.events().isEmpty()) {
51+
// avoid to increment batch count for empty batches
52+
currentBatchDimensions.set(Arrays.asList(0L, 0L));
5253
return;
5354
}
5455

0 commit comments

Comments
 (0)