Browse Source

New developer tool: cosmetics

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2472 a333f486-631f-4898-b8df-5754b55c2be0
romainq 12 years ago
parent
commit
25652088b2
5 changed files with 8 additions and 5 deletions
  1. 1 1
      core/metamodel.class.php
  2. 1 1
      pages/UI.php
  3. 2 0
      pages/run_query.php
  4. 1 1
      test/benchmark.php
  5. 3 2
      test/replay_query_log.php

+ 1 - 1
core/metamodel.class.php

@@ -2371,7 +2371,7 @@ abstract class MetaModel
 		}
 	}
 
-	public static function ShowQueryTrace()
+	public static function RecordQueryTrace()
 	{
 		if (!self::$m_bTraceQueries) return;
 

+ 1 - 1
pages/UI.php

@@ -2122,7 +2122,7 @@ EOF
 	$oKPI->ComputeAndReport('GUI creation before output');
 
 	ExecutionKPI::ReportStats();
-	MetaModel::ShowQueryTrace();
+	MetaModel::RecordQueryTrace();
 
 	DisplayWelcomePopup($oP);
 	$oP->output();	

+ 2 - 0
pages/run_query.php

@@ -225,5 +225,7 @@ catch(Exception $e)
 	$oP->p('<b>'.Dict::Format('UI:RunQuery:Error', $e->getMessage()).'</b>');
 }
 
+MetaModel::RecordQueryTrace();
+
 $oP->output();
 ?>

+ 1 - 1
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();
 ?>

+ 3 - 2
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);
 		}
 	}
 }