{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} {% if collector.totals.calls > 0 %} {% set icon %} {{ source('@WebProfiler/Icon/cache.svg') }} {{ collector.totals.calls }} in {{ '%0.2f'|format(collector.totals.time * 1000) }} ms {% endset %} {% set text %}
Cache Calls {{ collector.totals.calls }}
Total time {{ '%0.2f'|format(collector.totals.time * 1000) }} ms
Cache hits {{ collector.totals.hits }} / {{ collector.totals.reads }}{% if collector.totals.hit_read_ratio is not null %} ({{ collector.totals.hit_read_ratio }}%){% endif %}
Cache writes {{ collector.totals.writes }}
{% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }} {% endif %} {% endblock %} {% block menu %} {{ source('@WebProfiler/Icon/cache.svg') }} Cache {% endblock %} {% block panel %}

Cache

{% if collector.totals.calls == 0 %}

No cache calls were made.

{% else %} {{ _self.render_metrics(collector.totals, true) }}

Pools

{# the empty merge is needed to turn the iterator into an array #} {% set cache_pools_with_calls = collector.calls|filter(calls => calls|length > 0)|merge([]) %} {% for name, calls in cache_pools_with_calls %}

{{ name }} {{ collector.statistics[name].calls }}

Adapter

{% if collector.adapters[name] is defined %} {{ collector.adapters[name] }} {% else %} Unable to get the adapter class. {% endif %}
{% if calls|length == 0 %}

No calls were made for {{ name }} pool.

{% else %}

Metrics

{{ _self.render_metrics(collector.statistics[name]) }}

Calls

{% for call in calls %} {% endfor %}
# Time Call Hit
{{ loop.index }} {{ '%0.2f'|format((call.end - call.start) * 1000) }} ms {{ call.name }}() {{ profiler_dump(call.value.result, maxDepth=2) }}
{% endif %}
{% if loop.last %}

Pools without calls {{ collector.calls|filter(calls => 0 == calls|length)|length }}

{% for cache_pool in collector.calls|filter(calls => 0 == calls|length)|keys|sort %} {% endfor %}
Cache pools that received no calls
{{ cache_pool }}
{% endif %} {% endfor %}
{% endif %} {% endblock %} {% macro render_metrics(pool, is_total = false) %}
{{ pool.calls }} {{ is_total ? 'Total calls' : 'Calls' }}
{{ '%0.2f'|format(pool.time * 1000) }} ms {{ is_total ? 'Total time' : 'Time' }}
{{ pool.reads }} {{ is_total ? 'Total reads' : 'Reads' }}
{{ pool.writes }} {{ is_total ? 'Total writes' : 'Writes' }}
{{ pool.deletes }} {{ is_total ? 'Total deletes' : 'Deletes' }}
{{ pool.hits }} {{ is_total ? 'Total hits' : 'Hits' }}
{{ pool.misses }} {{ is_total ? 'Total misses' : 'Misses' }}
{{ pool.hit_read_ratio ?? 0 }} % Hits/reads
{% endmacro %}