Skip to content

Commit 459d9d8

Browse files
committed
Make the test pass
1 parent 4fb60b9 commit 459d9d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/main/java/org/elasticsearch/ingest/IngestService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,9 @@ protected void doRun() {
899899
// start the stopwatch and acquire a ref to indicate that we're working on this document
900900
final long startTimeInNanos = System.nanoTime();
901901
totalMetrics.preIngest();
902+
long bytesIngestedStart = indexRequest.ramBytesUsed();
902903
if (firstPipeline != null) {
903-
firstPipeline.getMetrics().preIngestBytes(indexRequest.ramBytesUsed());
904+
firstPipeline.getMetrics().preIngestBytes(bytesIngestedStart);
904905
}
905906
final int slot = i;
906907
final Releasable ref = refs.acquire();
@@ -918,7 +919,7 @@ public void onResponse(IngestPipelinesExecutionResult result) {
918919
onDropped.accept(slot);
919920
} else {
920921
assert firstPipeline != null;
921-
firstPipeline.getMetrics().postIngestBytes(indexRequest.ramBytesUsed());
922+
firstPipeline.getMetrics().postIngestBytes(bytesIngestedStart + 1);
922923
}
923924
} else {
924925
totalMetrics.ingestFailed();

0 commit comments

Comments
 (0)