From 85974da27bb9b94fa3a64a9265d587d690e96f86 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 27 Nov 2012 17:24:35 +0000 Subject: [PATCH] New developer tool: cosmetics SVN:trunk[2472] --- core/metamodel.class.php | 2 +- pages/UI.php | 2 +- pages/run_query.php | 2 ++ test/benchmark.php | 2 +- test/replay_query_log.php | 5 +++-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 186c2b49c..97d44e6fe 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -2371,7 +2371,7 @@ abstract class MetaModel } } - public static function ShowQueryTrace() + public static function RecordQueryTrace() { if (!self::$m_bTraceQueries) return; diff --git a/pages/UI.php b/pages/UI.php index 94e6700fe..81dbb06bd 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -2122,7 +2122,7 @@ EOF $oKPI->ComputeAndReport('GUI creation before output'); ExecutionKPI::ReportStats(); - MetaModel::ShowQueryTrace(); + MetaModel::RecordQueryTrace(); DisplayWelcomePopup($oP); $oP->output(); diff --git a/pages/run_query.php b/pages/run_query.php index 803413238..bf805612a 100644 --- a/pages/run_query.php +++ b/pages/run_query.php @@ -225,5 +225,7 @@ catch(Exception $e) $oP->p(''.Dict::Format('UI:RunQuery:Error', $e->getMessage()).''); } +MetaModel::RecordQueryTrace(); + $oP->output(); ?> diff --git a/test/benchmark.php b/test/benchmark.php index 8b02e23d4..67ad9d7a3 100644 --- a/test/benchmark.php +++ b/test/benchmark.php @@ -867,6 +867,6 @@ catch(ZZCoreException $e) } $oKPI->ComputeAndReport('Total execution'); // too big (showing all queries) ExecutionKPI::ReportStats(); -//MetaModel::ShowQueryTrace(); +//MetaModel::RecordQueryTrace(); $oP->output(); ?> diff --git a/test/replay_query_log.php b/test/replay_query_log.php index f30a1139e..54b4fa7d3 100644 --- a/test/replay_query_log.php +++ b/test/replay_query_log.php @@ -97,7 +97,7 @@ case 'benchmark': // Reset the log contents file_put_contents(APPROOT.'data/queries.results.log', date('Y-m-d H:i:s')."\n"); file_put_contents(APPROOT.'data/queries.benchmark.csv', ''); - LogBenchmarkCSV('oql', 'type', 'properties', 'make duration', 'tables', 'query length', 'exec duration', 'rows'); + LogBenchmarkCSV('type', 'properties', 'make duration', 'class', 'tables', 'query length', 'exec duration', 'rows', 'oql'); foreach ($aQueriesLog as $sQueryId => $aOqlData) { @@ -106,6 +106,7 @@ case 'benchmark': $aQueryData = unserialize($aOqlData['data']); $oFilter = $aQueryData['filter']; + $sClass = $oFilter->GetClass(); $aArgs = $aQueryData['args']; if ($aQueryData['type'] == 'select') @@ -213,7 +214,7 @@ case 'benchmark': } LogResult("row count = ".$iRowCount); - LogBenchmarkCSV($sOql, $sQueryType, $sQueryDesc, round($fMakeDuration, 3), $iTableCount, strlen($sSql), round($fExecDuration, 3), $iRowCount); + LogBenchmarkCSV($sQueryType, $sQueryDesc, round($fMakeDuration, 3), $sClass, $iTableCount, strlen($sSql), round($fExecDuration, 3), $iRowCount, $sOql); } } }