Commit b0cd6dfb by Scott

Fix coding style

parent 78b969da
...@@ -59,9 +59,9 @@ class Usage ...@@ -59,9 +59,9 @@ class Usage
$rusage = getrusage(); $rusage = getrusage();
$usage['cpu'] = $rusage["ru_utime.tv_sec"] + $rusage["ru_stime.tv_sec"] $usage['cpu'] = $rusage["ru_utime.tv_sec"] + $rusage["ru_stime.tv_sec"]
+ ($rusage["ru_utime.tv_usec"] + $rusage["ru_stime.tv_usec"]) / 1000000; + ($rusage["ru_utime.tv_usec"] + $rusage["ru_stime.tv_usec"]) / 1000000;
} } else {
else
$usage['cpu'] = 0; $usage['cpu'] = 0;
}
$usage['other'] = $usage['clock'] - $usage['cpu'] - $usage['mysql']; $usage['other'] = $usage['clock'] - $usage['cpu'] - $usage['mysql'];
...@@ -92,10 +92,12 @@ class Usage ...@@ -92,10 +92,12 @@ class Usage
if (strlen($this->databaseQueryLog) < 1048576) { // don't keep track of big tests if (strlen($this->databaseQueryLog) < 1048576) { // don't keep track of big tests
$rowcolstring = ''; $rowcolstring = '';
if (is_numeric($gotrows)) if (is_numeric($gotrows)) {
$rowcolstring .= ' - ' . $gotrows . ($gotrows == 1 ? ' row' : ' rows'); $rowcolstring .= ' - ' . $gotrows . ($gotrows == 1 ? ' row' : ' rows');
if (is_numeric($gotcolumns)) }
if (is_numeric($gotcolumns)) {
$rowcolstring .= ' - ' . $gotcolumns . ($gotcolumns == 1 ? ' column' : ' columns'); $rowcolstring .= ' - ' . $gotcolumns . ($gotcolumns == 1 ? ' column' : ' columns');
}
$this->databaseQueryLog .= $query . "\n\n" . sprintf('%.2f ms', $usedtime*1000) . $rowcolstring . "\n\n"; $this->databaseQueryLog .= $query . "\n\n" . sprintf('%.2f ms', $usedtime*1000) . $rowcolstring . "\n\n";
} }
...@@ -182,8 +184,9 @@ class Usage ...@@ -182,8 +184,9 @@ class Usage
<tr> <tr>
<td class="debug-cell-files"> <td class="debug-cell-files">
<textarea class="debug-output" cols="40" rows="20"><?php <textarea class="debug-output" cols="40" rows="20"><?php
foreach (get_included_files() as $file) foreach (get_included_files() as $file) {
echo qa_html(implode('/', array_slice(explode('/', $file), -3)))."\n"; echo qa_html(implode('/', array_slice(explode('/', $file), -3)))."\n";
}
?></textarea> ?></textarea>
</td> </td>
<td class="debug-cell-queries"> <td class="debug-cell-queries">
...@@ -206,8 +209,9 @@ class Usage ...@@ -206,8 +209,9 @@ class Usage
{ {
$delta = array(); $delta = array();
foreach ($newusage as $key => $value) foreach ($newusage as $key => $value) {
$delta[$key] = max(0, $value-@$oldusage[$key]); $delta[$key] = max(0, $value-@$oldusage[$key]);
}
return $delta; return $delta;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment