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:
parent
506ff1fd45
commit
ee8bd63a08
3 changed files with 72 additions and 254 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue