From fab8cabe19ac99e3c8a95abcea3c0569b67045bb Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 3 Feb 2016 20:03:35 +0100 Subject: show elasticsearch query time --- www/index.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'www/index.php') diff --git a/www/index.php b/www/index.php index 257ad87..498cf93 100644 --- a/www/index.php +++ b/www/index.php @@ -54,8 +54,10 @@ function buildLink($baseLink, $filters, $addFilterType, $addFilterValue) return $baseLink; } +$timeBegin = microtime(true); $es = new Elasticsearch($GLOBALS['phinde']['elasticsearch']); $res = $es->search($query, $filters, $page, $perPage); +$timeEnd = microtime(true); $pager = new Html_Pager( $res->hits->total, $perPage, $page + 1, @@ -84,6 +86,7 @@ foreach ($res->aggregations as $key => &$aggregation) { render( 'search', array( + 'queryTime' => round($timeEnd - $timeBegin, 2) . 'ms', 'query' => $query, 'hitcount' => $res->hits->total, 'hits' => $res->hits->hits, -- cgit v1.2.3