Add total hits to the search slow log (#29034)

This commit adds the total hits to the search slow log.
This commit is contained in:
Jason Tedor 2018-03-13 20:40:47 -04:00 committed by GitHub
parent 8f0da37c5e
commit 46fcd07153
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -149,8 +149,11 @@ public final class SearchSlowLog implements SearchOperationListener {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(context.indexShard().shardId()).append(" ");
sb.append("took[").append(TimeValue.timeValueNanos(tookInNanos)).append("], took_millis[").append(TimeUnit.NANOSECONDS.toMillis(tookInNanos)).append("], ");
sb.append(context.indexShard().shardId())
.append(" ")
.append("took[").append(TimeValue.timeValueNanos(tookInNanos)).append("], ")
.append("took_millis[").append(TimeUnit.NANOSECONDS.toMillis(tookInNanos)).append("], ")
.append("total_hits[").append(context.queryResult().getTotalHits()).append("], ");
if (context.getQueryShardContext().getTypes() == null) {
sb.append("types[], ");
} else {