Modified Profiler message.
This commit is contained in:
@ -39,7 +39,7 @@ class ProfilerTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testGetInstaceNoDebug()
|
public function testGetInstaceNoDebug()
|
||||||
{
|
{
|
||||||
Config::set('PROFILER', false);
|
Config::set('PROFILER', false);
|
||||||
$this->setExpectedException('GeneralException', 'Need to turn on PROFILER before use.');
|
$this->setExpectedException('GeneralException', 'Need turn PROFILER before use.');
|
||||||
Profiler::getInstance();
|
Profiler::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class Profiler
|
|||||||
private function __construct()
|
private function __construct()
|
||||||
{
|
{
|
||||||
if (Config::get('PROFILER') == false) {
|
if (Config::get('PROFILER') == false) {
|
||||||
throw new GeneralException('Need to turn on PROFILER before use.');
|
throw new GeneralException('Need turn PROFILER before use.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ class Profiler
|
|||||||
$html = '<div style="clear:both; font:12px monospace; margin: 5px; white-space: pre;">'
|
$html = '<div style="clear:both; font:12px monospace; margin: 5px; white-space: pre;">'
|
||||||
. 'Elapsed time: ' . round(($this->end - $this->start) * 1000, 2) . 'ms.<br/>';
|
. 'Elapsed time: ' . round(($this->end - $this->start) * 1000, 2) . 'ms.<br/>';
|
||||||
if (count($this->queries) == 0 && !Config::get('PROFILER_DETAILS')) {
|
if (count($this->queries) == 0 && !Config::get('PROFILER_DETAILS')) {
|
||||||
$html .= 'Queries not counted. Turn PROFILER_DETAILS on true, if you want to profile queries.<br>';
|
$html .= 'Queries not counted. Turn PROFILER_DETAILS if you want to profile queries.<br/>';
|
||||||
} else {
|
} else {
|
||||||
$html .= 'Queries: ' . count($this->queries) . ' [' . round($queriesTime * 1000, 2) . ' ms]<br/>';
|
$html .= 'Queries: ' . count($this->queries) . ' [' . round($queriesTime * 1000, 2) . ' ms]<br/>';
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ class Profiler
|
|||||||
$queriesTime += $query->getElapsed();
|
$queriesTime += $query->getElapsed();
|
||||||
}
|
}
|
||||||
if (count($this->queries) == 0 && !Config::get('PROFILER_DETAILS')) {
|
if (count($this->queries) == 0 && !Config::get('PROFILER_DETAILS')) {
|
||||||
FB::table('Queries not counted. Turn PROFILER_DETAILS on true, if you want to profile queries.', $table);
|
FB::table('Queries not counted. Turn PROFILER_DETAILS if you want to profile queries.', $table);
|
||||||
} else {
|
} else {
|
||||||
FB::table('Queries: ' . count($this->queries) . ' [' . round($queriesTime * 1000, 2) . ' ms]', $table);
|
FB::table('Queries: ' . count($this->queries) . ' [' . round($queriesTime * 1000, 2) . ' ms]', $table);
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ class Profiler
|
|||||||
$html = str_pad(PHP_EOL, 60, '-', STR_PAD_LEFT);
|
$html = str_pad(PHP_EOL, 60, '-', STR_PAD_LEFT);
|
||||||
$html .= 'Elapsed time: ' . round(($this->end - $this->start) * 1000, 2) . 'ms.' . PHP_EOL;
|
$html .= 'Elapsed time: ' . round(($this->end - $this->start) * 1000, 2) . 'ms.' . PHP_EOL;
|
||||||
if (count($this->queries) == 0 && !Config::get('PROFILER_DETAILS')) {
|
if (count($this->queries) == 0 && !Config::get('PROFILER_DETAILS')) {
|
||||||
$html .= 'Queries not counted. Turn PROFILER_DETAILS on true, if you want to profile queries.' . PHP_EOL;
|
$html .= 'Queries not counted. Turn PROFILER_DETAILS if you want to profile queries.' . PHP_EOL;
|
||||||
} else {
|
} else {
|
||||||
$html .= 'Queries: ' . count($this->queries) . ' [' . round($queriesTime * 1000, 2) . ' ms] ' . PHP_EOL;
|
$html .= 'Queries: ' . count($this->queries) . ' [' . round($queriesTime * 1000, 2) . ' ms] ' . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user