Add totalquery time in debugbar (like Doctrine does)

This commit is contained in:
tyx 2013-02-21 10:30:05 +01:00 committed by Timothée Barray
commit 9c60a5ccac
2 changed files with 14 additions and 0 deletions

View file

@ -40,6 +40,16 @@ class ElasticaDataCollector extends DataCollector
return $this->data['queries'];
}
public function getTime()
{
$time = 0;
foreach ($this->data['queries'] as $query) {
$time += $query['executionMS'];
}
return $time;
}
/**
* {@inheritdoc}
*/

View file

@ -10,6 +10,10 @@
<b>Queries</b>
<span>{{ collector.querycount }}</span>
</div>
<div class="sf-toolbar-info-piece">
<b>Query Time</b>
<span>{{ '%0.2f'|format(collector.time * 1000) }} ms</span>
</div>
{% endset %}
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
{% endblock %}