Skip to content

Commit

Permalink
Merge pull request #751 from cakephp/port-750
Browse files Browse the repository at this point in the history
Back-port #750 to 3.x
  • Loading branch information
othercorey authored Apr 13, 2020
2 parents fbe68d1 + 003ed0e commit 2faf742
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Panel/TimerPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function implementedEvents()
{
$before = function ($name) {
return function () use ($name) {
DebugTimer::start($name, __d('debug_kit', $name));
DebugTimer::start($name);
};
};
$after = function ($name) {
Expand All @@ -50,7 +50,7 @@ public function implementedEvents()
return [
'Controller.initialize' => [
['priority' => 0, 'callable' => function () {
DebugMemory::record(__d('debug_kit', 'Controller initialization'));
DebugMemory::record('Controller initialization');
}],
['priority' => 0, 'callable' => $before('Event: Controller.initialize')],
['priority' => 999, 'callable' => $after('Event: Controller.initialize')],
Expand All @@ -59,19 +59,19 @@ public function implementedEvents()
['priority' => 0, 'callable' => $before('Event: Controller.startup')],
['priority' => 999, 'callable' => $after('Event: Controller.startup')],
['priority' => 999, 'callable' => function () {
DebugMemory::record(__d('debug_kit', 'Controller action start'));
DebugTimer::start(__d('debug_kit', 'Controller action'));
DebugMemory::record('Controller action start');
DebugTimer::start('Controller: action');
}],
],
'Controller.beforeRender' => [
['priority' => 0, 'callable' => function () {
DebugTimer::stop(__d('debug_kit', 'Controller action'));
DebugTimer::stop('Controller: action');
}],
['priority' => 0, 'callable' => $before('Event: Controller.beforeRender')],
['priority' => 999, 'callable' => $after('Event: Controller.beforeRender')],
['priority' => 999, 'callable' => function () {
DebugMemory::record(__d('debug_kit', 'View Render start'));
DebugTimer::start(__d('debug_kit', 'View Render start'));
DebugMemory::record('View Render start');
DebugTimer::start('View: Render');
}],
],
'View.beforeRender' => $both('View.beforeRender'),
Expand All @@ -80,19 +80,19 @@ public function implementedEvents()
'View.afterLayout' => $both('View.afterLayout'),
'View.beforeRenderFile' => [
['priority' => 0, 'callable' => function ($event, $filename) {
DebugTimer::start(__d('debug_kit', 'Render {0}', $filename));
DebugTimer::start('Render File: ' . $filename);
}],
],
'View.afterRenderFile' => [
['priority' => 0, 'callable' => function ($event, $filename) {
DebugTimer::stop(__d('debug_kit', 'Render {0}', $filename));
DebugTimer::stop('Render File: ' . $filename);
}],
],
'Controller.shutdown' => [
['priority' => 0, 'callable' => $before('Event: Controller.shutdown')],
['priority' => 0, 'callable' => function () {
DebugTimer::stop(__d('debug_kit', 'View Render start'));
DebugMemory::record(__d('debug_kit', 'Controller shutdown'));
DebugTimer::stop('View: Render');
DebugMemory::record('Controller shutdown');
}],
['priority' => 999, 'callable' => $after('Event: Controller.shutdown')],
],
Expand Down

0 comments on commit 2faf742

Please sign in to comment.