{% extends request.isXmlHttpRequest ? '@WebProfiler/Profiler/ajax_layout.html.twig' : '@WebProfiler/Profiler/layout.html.twig' %} {% import _self as helper %} {% block toolbar %} {% if collector.querycount > 0 or collector.invalidEntityCount > 0 %} {% set profiler_markup_version = profiler_markup_version|default(1) %} {% set icon %} {% if profiler_markup_version == 1 %} Database {{ collector.querycount }} {% if collector.querycount > 0 %} in {{ '%0.2f'|format(collector.time * 1000) }} ms {% endif %} {% if collector.invalidEntityCount > 0 %} {{ collector.invalidEntityCount }} {% endif %} {% else %} {% set status = collector.invalidEntityCount > 0 ? 'red' : collector.querycount > 50 ? 'yellow' %} {{ include('@Doctrine/Collector/icon.svg') }} {% if collector.querycount == 0 and collector.invalidEntityCount > 0 %} {{ collector.invalidEntityCount }} errors {% else %} {{ collector.querycount }} in {{ '%0.2f'|format(collector.time * 1000) }} ms {% endif %} {% endif %} {% endset %} {% set text %}
Database Queries {{ collector.querycount }}
Query time {{ '%0.2f'|format(collector.time * 1000) }} ms
Invalid entities {{ collector.invalidEntityCount }}
{% if collector.cacheEnabled %}
Cache hits {{ collector.cacheHitsCount }}
Cache misses {{ collector.cacheMissesCount }}
Cache puts {{ collector.cachePutsCount }}
{% else %}
Second Level Cache disabled
{% endif %} {% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status|default('') }) }} {% endif %} {% endblock %} {% block menu %} {% set profiler_markup_version = profiler_markup_version|default(1) %} {% if profiler_markup_version == 1 %} Doctrine {{ collector.querycount }} {{ '%0.0f'|format(collector.time * 1000) }} ms {% else %} {{ include('@Doctrine/Collector/icon.svg') }} Doctrine {% if collector.invalidEntityCount %} {{ collector.invalidEntityCount }} {% endif %} {% endif %} {% endblock %} {% block panel %} {% set profiler_markup_version = profiler_markup_version|default(1) %} {% if 'explain' == page %} {{ render(controller('DoctrineBundle:Profiler:explain', { token: token, panel: 'db', connectionName: request.query.get('connection'), query: request.query.get('query') })) }} {% else %} {{ block('queries') }} {% endif %} {% endblock %} {% block queries %} {% if profiler_markup_version > 1 %}

Query Metrics

{{ collector.querycount }} Database Queries
{{ collector.groupedQueryCount }} Different statements
{{ '%0.2f'|format(collector.time * 1000) }} ms Query time
{{ collector.invalidEntityCount }} Invalid entities
{% if collector.cacheEnabled %}
{{ collector.cacheHitsCount }} Cache hits
{{ collector.cacheMissesCount }} Cache misses
{{ collector.cachePutsCount }} Cache puts
{% endif %}
{% endif %} {% set group_queries = request.query.getBoolean('group') %} {% if group_queries %}

Grouped Statements

Show all queries

{% else %}

Queries

Group similar statements

{% endif %} {% for connection, queries in collector.queries %} {% if collector.connections|length > 1 %}

{{ connection }} connection

{% endif %} {% if queries is empty %}

No database queries were performed.

{% else %} {% if group_queries %} {% set queries = collector.groupedQueries[connection] %} {% endif %} {% if group_queries %} {% else %} {% endif %} {% for i, query in queries %} {% set i = group_queries ? query.index : i %} {% if group_queries %} {% else %} {% endif %} {% endfor %}
Time Count# TimeInfo
{{ '%0.2f'|format(query.executionMS * 1000) }} ms
({{ '%0.2f'|format(query.executionPercent) }}%)
{{ query.count }}{{ loop.index }} {{ '%0.2f'|format(query.executionMS * 1000) }} ms {{ query.sql|doctrine_pretty_query(highlight_only = true) }}
Parameters: {{ profiler_dump(query.params, 2) }}
View formatted query    View runnable query {% if query.explainable %}    Explain query {% endif %} {% if query.backtrace is defined %}    View query backtrace {% endif %}
{% if query.explainable %}
{% endif %} {% if query.backtrace is defined %} {% endif %}
{% endif %} {% endfor %}

Database Connections

{% if not collector.connections %}

There are no configured database connections.

{% else %} {{ helper.render_simple_table('Name', 'Service', collector.connections) }} {% endif %}

Entity Managers

{% if not collector.managers %}

There are no configured entity managers.

{% else %} {{ helper.render_simple_table('Name', 'Service', collector.managers) }} {% endif %}

Second Level Cache

{% if not collector.cacheEnabled %}

Second Level Cache is not enabled.

{% else %} {% if not collector.cacheCounts %}

Second level cache information is not available.

{% else %} {% if profiler_markup_version == 1 %} {{ helper.render_simple_table('Key', 'Value', collector.cacheCounts) }} {% else %}
{{ collector.cacheCounts.hits }} Hits
{{ collector.cacheCounts.misses }} Misses
{{ collector.cacheCounts.puts }} Puts
{% endif %} {% if collector.cacheRegions.hits %}

Number of cache hits

{{ helper.render_simple_table('Region', 'Hits', collector.cacheRegions.hits) }} {% endif %} {% if collector.cacheRegions.misses %}

Number of cache misses

{{ helper.render_simple_table('Region', 'Misses', collector.cacheRegions.misses) }} {% endif %} {% if collector.cacheRegions.puts %}

Number of cache puts

{{ helper.render_simple_table('Region', 'Puts', collector.cacheRegions.puts) }} {% endif %} {% endif %} {% endif %}

Entities Mapping

{% for manager, classes in collector.entities %} {% if collector.managers|length > 1 %}

{{ manager }} entity manager

{% endif %} {% if classes is empty %}

No loaded entities.

{% else %} {% for class in classes %} {% set contains_errors = collector.mappingErrors[manager] is defined and collector.mappingErrors[manager][class] is defined %} {% endfor %}
Class Mapping errors
{{ class }} {% if contains_errors %}
    {% for error in collector.mappingErrors[manager][class] %}
  • {{ error }}
  • {% endfor %}
{% else %} No errors. {% endif %}
{% endif %} {% endfor %} {% endblock %} {% macro render_simple_table(label1, label2, data) %} {% for key, value in data %} {% endfor %}
{{ label1 }} {{ label2 }}
{{ key }} {{ value }}
{% endmacro %}