aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2016-02-03 20:03:35 +0100
committerChristian Weiske <cweiske@cweiske.de>2016-02-03 20:03:35 +0100
commitfab8cabe19ac99e3c8a95abcea3c0569b67045bb (patch)
tree9509ba8528ae8a539f78be29199442f4fdb559d5 /www
parente5c7780adb59e8038a040a1e534a4cee1fac8cd8 (diff)
downloadphinde-fab8cabe19ac99e3c8a95abcea3c0569b67045bb.tar.gz
phinde-fab8cabe19ac99e3c8a95abcea3c0569b67045bb.zip
show elasticsearch query time
Diffstat (limited to 'www')
-rw-r--r--www/index.php3
1 files changed, 3 insertions, 0 deletions
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,