From 85ac4a9a320d6ebf963a6fe60541c1110b037d15 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 29 Sep 2015 16:35:27 -0700 Subject: [PATCH] [Search] Log indexing time ...to aid in tuning of generic search parameters. --- platform/search/bundle.json | 1 + platform/search/src/services/GenericSearchProvider.js | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/search/bundle.json b/platform/search/bundle.json index c0dd7e29a9..67dc058ed9 100644 --- a/platform/search/bundle.json +++ b/platform/search/bundle.json @@ -47,6 +47,7 @@ "implementation": "services/GenericSearchProvider.js", "depends": [ "$q", + "$log", "throttle", "objectService", "workerService", diff --git a/platform/search/src/services/GenericSearchProvider.js b/platform/search/src/services/GenericSearchProvider.js index a2b0fdd407..3eb31f255a 100644 --- a/platform/search/src/services/GenericSearchProvider.js +++ b/platform/search/src/services/GenericSearchProvider.js @@ -41,6 +41,7 @@ define( * * @constructor * @param $q Angular's $q, for promise consolidation. + * @param $log Anglar's $log, for logging. * @param {Function} throttle a function to throttle function invocations * @param {ObjectService} objectService The service from which * domain objects can be gotten. @@ -49,12 +50,13 @@ define( * @param {GENERIC_SEARCH_ROOTS} ROOTS An array of the root * domain objects' IDs. */ - function GenericSearchProvider($q, throttle, objectService, workerService, topic, ROOTS) { + function GenericSearchProvider($q, $log, throttle, objectService, workerService, topic, ROOTS) { var indexed = {}, pendingQueries = {}, toIndex = {}, worker = workerService.run('genericSearchWorker'), mutationTopic = topic("mutation"), + indexingStarted = Date.now(), scheduleFlush; this.worker = worker; @@ -132,6 +134,11 @@ define( }); if (ids.length < 1) { + $log.info([ + 'GenericSearch finished indexing after ', + ((Date.now() - indexingStarted) / 1000).toFixed(2), + ' seconds.' + ].join('')); return; }