{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% import _self as helper %} {% block toolbar %} {% set warningThreshold = 5 %} {% set icon %} {{ include('@EmoeGuzzle/Icon/Icon.svg') }} {{ collector.requests|length }} {% set status = collector.errorRequests|length ? 'red' : collector.requests|length > warningThreshold ? 'yellow' %} {% endset %} {% set text %}
Total Requests {{ collector.requests|length }}
Success {{ collector.requests|length - collector.errorRequests|length }}
Errors {{ collector.errorRequests|length }}
Total Duration {{ collector.totalDuration }} ms
{% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status|default('') }) }} {% endblock %} {% block menu %} {% set warningThreshold = 5 %} {% set statusClass = collector.errorRequests|length ? 'label-status-error' : collector.requests|length > warningThreshold ? 'label-status-warning' %} Guzzle {% if collector.errorRequests|length %} {{ collector.errorRequests|length }} {% elseif collector.requests|length > warningThreshold %} {{ collector.requests|length }} {% endif %} {% endblock %} {% block panel %} {% set timeThreshold = 500 %}

HTTP requests

{% if collector.requests|length == 0 %}

No requests sent.

{% else %} {% set methods = ['GET', 'POST', 'PUT', 'DELETE', 'OTHER'] %} {# sort collected logs in groups #} {% set groups = {} %} {% for request in collector.requests %} {% if request.method in methods %} {% set groups = groups|merge({(request.method): (groups[request.method]|default([])|merge([request]))}) %} {% else %} {% set groups = groups|merge({'OTHER': [request]}) %} {% endif %} {% endfor %} {% set groups = groups|merge({'ALL': collector.requests}) %}
{% for method in ['ALL']|merge(methods) %}

{{ method }} {{ groups[method]|default([])|length }}

{% if groups[method] is defined %} {% for request in groups[method] %} {% set id = method ~ loop.index %} {% set class = request.is_error ? 'status-error' : request.time > timeThreshold ? 'status-warning' : '' %} {% endfor %}
{{ request.message }} ({{ request.time|number_format }} ms)
{% else %}

There are no log messages of this level.

{% endif %}
{% endfor %}
{% endif %} {% endblock %}