Working on that new profiler

Gotta figure out what's going on with the database portion, it's going all
crazy on me.
This commit is contained in:
Josh Sherman 2014-10-01 07:41:01 -04:00
parent 506ff1fd45
commit ee8bd63a08
3 changed files with 72 additions and 254 deletions

View file

@ -326,23 +326,20 @@ class Resource extends Object
}
else
{
/*
// Starts a timer before the resource is executed
if ($this->config['pickles']['profiler'])
{
Profiler::timer('resource ' . $method);
$timer = get_class($this) . '->' . $method . '()';
Profiler::timer($timer);
}
*/
$this->response = $this->$method();
/*
// Stops the resource timer
if ($this->config['pickles']['profiler'])
{
Profiler::timer('resource ' . $method);
Profiler::timer($timer);
}
*/
}
}
}
@ -402,6 +399,11 @@ class Resource extends Object
}
}
if ($this->config['pickles']['profiler'])
{
$response['profiler'] = Profiler::report();
}
$pretty = isset($_REQUEST['pretty']) ? JSON_PRETTY_PRINT : false;
echo json_encode($response, $pretty);