Skip to content

Commit 48cf35f

Browse files
committed
Fix processingTime update
Update the processingTime input metric only once after the for loop using the time since processingStartTime. Before this change, by updating processingStartTime inside the loop we ended up counting time multiple times.
1 parent fe5c564 commit 48cf35f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

x-pack/filebeat/input/azureeventhub/v2_input.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,11 @@ func (in *eventHubInputV2) processReceivedEvents(receivedEvents []*azeventhubs.R
561561

562562
// Update input metrics.
563563
in.metrics.processedMessages.Inc()
564-
in.metrics.processingTime.Update(time.Since(processingStartTime).Nanoseconds())
565564
}
566565

566+
// Update input metrics.
567+
in.metrics.processingTime.Update(time.Since(processingStartTime).Nanoseconds())
568+
567569
return nil
568570
}
569571

0 commit comments

Comments
 (0)