display hits and total hits for courier inspector requests (#23434) (#23449)

* display hits and total hits for courier inspector requests

* update Hits help text to explain difference between total hits

* fix functional test
This commit is contained in:
Nathan Reese 2018-09-24 13:46:22 -06:00 committed by GitHub
parent c51ec363a3
commit a5950b7db6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -54,10 +54,15 @@ function getResponseInspectorStats(searchSource, resp) {
}
if (resp && resp.hits) {
stats.Hits = {
stats['Hits (total)'] = {
value: `${resp.hits.total}`,
description: 'The number of documents that match the query.',
};
stats.Hits = {
value: `${resp.hits.hits.length}`,
description: 'The number of documents returned by the query.',
};
}
if (lastRequest && (lastRequest.ms === 0 || lastRequest.ms)) {

View file

@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }) {
const STATS_ROW_VALUE_INDEX = 1;
function getHitCount(requestStats) {
const hitsCountStatsRow = requestStats.find((statsRow) => {
return statsRow[STATS_ROW_NAME_INDEX] === 'Hits';
return statsRow[STATS_ROW_NAME_INDEX] === 'Hits (total)';
});
return hitsCountStatsRow[STATS_ROW_VALUE_INDEX];
}