New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ingest_took
to bulk response
#16876
Conversation
@@ -101,6 +101,7 @@ void processIndexRequest(Task task, String action, ActionListener listener, Acti | |||
} | |||
|
|||
void processBulkIndexRequest(Task task, BulkRequest original, String action, ActionFilterChain chain, ActionListener<BulkResponse> listener) { | |||
long ingestStartTime = System.currentTimeMillis(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use nano time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I picked System.currentTimeMillis()
is because that is what the bulk api uses too. Otherwise that would be inconsistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any time we measure deltas (how long something took) we should use nanoTime. currentTimeMillis can be reset by ntp ... if the bulk api uses it for this purpose, it should be fixed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we have millis everywhere else? isn't it better to keep millis here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I commented before reading your answer... ignore me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I can fix the bulk api to use nanoTime instead of currentTimeMillis in a separate PR.
@@ -106,6 +126,7 @@ public void readFrom(StreamInput in) throws IOException { | |||
responses[i] = BulkItemResponse.readBulkItem(in); | |||
} | |||
tookInMillis = in.readVLong(); | |||
ingestTookInMillis = in.readLong(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can sue ZLong for small values (FYI)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I didn't know this existed.
a9eb4e5
to
1016139
Compare
LGTM |
…ent on ingest preprocessing. The `ingest_took` is separate from `took`, which keeps track how much time is spent on indexing/deleting/updating. The `ingest_took` is only visible in the rest response if at least for one bulk item has ingest enabled.
this PR passes invalid tookInMillis values to serialization. https://github.com/elastic/elasticsearch/pull/16876/files#diff-764ab3948584e67f5cb1d566ef82186aR38 -1 is not allowed for vlong it must be positive. I have a failing test because of this:
|
argh scratch that - I misread the line... |
The
ingest_took
indicates how much time was spent on ingest preprocessing.The
ingest_took
is separate fromtook
, which keeps track how much time is spent on indexing/deleting/updating. Theingest_took
is only visible in the rest response if at least one index request has ingest enabled.