From 4827ada7cf823ef4d5adb6b7c07687334640bede Mon Sep 17 00:00:00 2001 From: Ben Plessinger Date: Fri, 15 May 2020 19:56:24 -0400 Subject: [PATCH] Make filter list building logging a bit better (#1311) --- bin/xdmod-build-filter-lists | 1 - classes/DB/FilterListBuilder.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/bin/xdmod-build-filter-lists b/bin/xdmod-build-filter-lists index 759136d25d..aeeee4510b 100755 --- a/bin/xdmod-build-filter-lists +++ b/bin/xdmod-build-filter-lists @@ -88,7 +88,6 @@ function build($realms, $logger){ if (count($realms) > 0){ foreach($realms as $realm){ if(!empty($realm)){ - $logger->notice('Building Filter List: ' . $realm); $filterListBuilder->buildRealmLists($realm); } } diff --git a/classes/DB/FilterListBuilder.php b/classes/DB/FilterListBuilder.php index ee9a0e94b6..2a4198f0fb 100644 --- a/classes/DB/FilterListBuilder.php +++ b/classes/DB/FilterListBuilder.php @@ -59,6 +59,14 @@ public function buildAllLists() public function buildRealmLists($realmName) { // Get a query for the given realm. + $startTime = microtime(true); + $this->logger->notice( + array( + 'message' => 'start', + 'action' => $realmName . '.build-filter-list' + ) + ); + $realmQuery = new \DataWarehouse\Query\AggregateQuery( $realmName, FilterListHelper::getQueryAggregationUnit(), @@ -74,6 +82,14 @@ public function buildRealmLists($realmName) foreach ($currentRealm->getGroupByObjects() as $groupByObj) { $this->buildDimensionLists($realmQuery, $groupByObj, $currentRealm); } + $this->logger->notice( + array( + 'message' => 'end', + 'action' => $realmName . '.build-filter-list', + 'start_time' => $startTime, + 'end_time' => microtime(true) + ) + ); } /** @@ -97,6 +113,14 @@ private function buildDimensionLists(iQuery $realmQuery, iGroupBy $groupBy, iRea // Generate the main list table. If the list table does not already // exist, create it. $dimensionId = $groupBy->getId(); + $startTime = microtime(true); + $this->logger->notice( + array( + 'message' => 'start', + 'action' => $currentRealm->getName() . '.build-filter-list.' . $dimensionId + ) + ); + $mainTableName = FilterListHelper::getTableName($realmQuery, $groupBy); $db = DB::factory('datawarehouse'); @@ -227,6 +251,14 @@ private function buildDimensionLists(iQuery $realmQuery, iGroupBy $groupBy, iRea $this->builtListTables[$pairTableName] = true; } + $this->logger->notice( + array( + 'message' => 'end', + 'action' => $currentRealm->getName() . '.build-filter-list.' . $dimensionId, + 'start_time' => $startTime, + 'end_time' => microtime(true) + ) + ); } /**