Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get time collector from loaded profile #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion view/base/templates/panel/cache.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\CacheCollector $collector
*/

use ClawRock\Debug\Model\Collector\CacheCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(CacheCollector::NAME);
?>
<h2><?= $escaper->escapeHtml(__('Cache metrics')) ?></h2>
<div class="metrics">
Expand Down
6 changes: 5 additions & 1 deletion view/base/templates/panel/config.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\ConfigCollector $collector
*/

use ClawRock\Debug\Model\Collector\ConfigCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(ConfigCollector::NAME);
?>
<h2><?= $escaper->escapeHtml(__('PHP Configuration')) ?></h2>
<div class="metrics">
Expand Down
6 changes: 5 additions & 1 deletion view/base/templates/panel/database.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\DatabaseCollector $collector
*/

use ClawRock\Debug\Model\Collector\DatabaseCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(DatabaseCollector::NAME);
?>
<div style="float:left; width: 50%">
<h2><?= $escaper->escapeHtml(__('Query metrics')) ?></h2>
Expand Down
6 changes: 5 additions & 1 deletion view/base/templates/panel/event.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\EventCollector $collector
*/

use ClawRock\Debug\Model\Collector\EventCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(EventCollector::NAME);
?>
<div>
<h2><?= $escaper->escapeHtml(__('Stats')) ?></h2>
Expand Down
13 changes: 5 additions & 8 deletions view/base/templates/panel/layout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\LayoutCollector $collector
*/

use ClawRock\Debug\Model\Collector\LayoutCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
?>
<?php
/** @var \Magento\Framework\View\Element\Template $block */
/** @var \ClawRock\Debug\Model\Collector\LayoutCollector $collector */
$collector = $block->getCollector();
/** @var \ClawRock\Debug\Model\View\Profiler $viewModel */
$viewModel = $block->getViewModel();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(LayoutCollector::NAME);
?>
<h2><?= $escaper->escapeHtml(__('Render Metrics')) ?></h2>
<div class="metrics">
Expand Down
6 changes: 5 additions & 1 deletion view/base/templates/panel/model.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\ModelCollector $collector
*/

use ClawRock\Debug\Model\Collector\ModelCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(ModelCollector::NAME);
?>
<h2><?= $escaper->escapeHtml(__('Model CRUD metrics')) ?></h2>
<div class="metrics">
Expand Down
6 changes: 5 additions & 1 deletion view/base/templates/panel/plugin.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\PluginCollector $collector
*/

use ClawRock\Debug\Model\Collector\PluginCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(PluginCollector::NAME);
?>
<div>
<h2><?= $escaper->escapeHtml(__('Plugins')) ?></h2>
Expand Down
6 changes: 5 additions & 1 deletion view/base/templates/panel/request.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\RequestCollector $collector
*/

use ClawRock\Debug\Model\Collector\RequestCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(RequestCollector::NAME);
?>
<div class="sf-tabs">
<div class="tab">
Expand Down
5 changes: 4 additions & 1 deletion view/base/templates/panel/time.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\TimeCollector $collector
*/

use ClawRock\Debug\Model\Collector\TimeCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(TimeCollector::NAME);
$events = $collector->getEvents();
?>
<h2><?= $escaper->escapeHtml(__('Performance metrics')) ?></h2>
Expand Down
6 changes: 5 additions & 1 deletion view/base/templates/panel/translation.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ declare(strict_types=1);
* @var \ClawRock\Debug\Model\View\Profiler $viewModel
* @var \ClawRock\Debug\Model\Collector\TranslationCollector $collector
*/

use ClawRock\Debug\Model\Collector\TranslationCollector;

$viewModel = $block->getViewModel();
$collector = $block->getCollector();
$profile = $viewModel->getProfile();
$collector = $profile->getCollector(TranslationCollector::NAME);
?>
<h2><?= $escaper->escapeHtml(__('Translation Metrics')) ?></h2>
<div class="metrics">
Expand Down