Permalink
Browse files

Add totalquery time in debugbar (like Doctrine does)

  • Loading branch information...
1 parent 2171755 commit 9c60a5ccaca0a2520bb98330cf86e6adff6665a8 @tyx tyx committed with tyx Feb 21, 2013
Showing with 14 additions and 0 deletions.
  1. +10 −0 DataCollector/ElasticaDataCollector.php
  2. +4 −0 Resources/views/Collector/elastica.html.twig
@@ -40,6 +40,16 @@ public function getQueries()
return $this->data['queries'];
}
+ public function getTime()
+ {
+ $time = 0;
+ foreach ($this->data['queries'] as $query) {
+ $time += $query['executionMS'];
+ }
+
+ return $time;
+ }
+
/**
* {@inheritdoc}
*/
@@ -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 %}

0 comments on commit 9c60a5c

Please sign in to comment.