Skip to content

Commit

Permalink
Make filter list building logging a bit better (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
plessbd authored May 15, 2020
1 parent 0f4b721 commit 4827ada
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
1 change: 0 additions & 1 deletion bin/xdmod-build-filter-lists
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
32 changes: 32 additions & 0 deletions classes/DB/FilterListBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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)
)
);
}

/**
Expand All @@ -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');
Expand Down Expand Up @@ -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)
)
);
}

/**
Expand Down

0 comments on commit 4827ada

Please sign in to comment.