From 87018d88f6268567faf3341f736032825873f078 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 20 May 2015 15:34:47 +0200 Subject: [PATCH] add logging for elasticsearch query execution time --- service/search.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/search.js b/service/search.js index d0882170..15b5cd14 100644 --- a/service/search.js +++ b/service/search.js @@ -18,6 +18,9 @@ function service( backend, cmd, cb ){ // handle backend errors if( err ){ return cb( err ); } + // log total ms elasticsearch reported the query took to execute + peliasLogger.verbose( 'time elasticsearch reported:', data.took / 1000 ); + // map returned documents var docs = []; if( data && data.hits && data.hits.total && Array.isArray(data.hits.hits)){