<commit_before>{% macro display_array_recursive(array, separator = ', ', opening_char = '[', closing_char = ']') -%}
{{ opening_char }}
{%- for key, value in array -%}
    {%- if value is iterable -%}
        {{ key }} => {{ _self.display_array_recursive(value, separator, opening_char, closing_char) }}
    {%- else -%}
        {{ key }} => {{ value }}
        {%- if not loop.last %}{{ separator }}{% endif -%}
    {%- endif -%}
{%- endfor -%}
{{ closing_char }}
{%- endmacro %}

<div id="request_{{ index }}" class="tab-pane active">
    {% set connection_percent = (100 * time.connection) / time.total %}
    {% set process_percent = (100 * (time.total - time.connection)) / time.total %}

    <h5>Time</h5>
    <table>
        <tbody>
            <tr>
                <th>Duration total</th>
                <td>{{ (time.total * 1000)|number_format(0, '', '') }} <small>ms</small></td>
            </tr>
            <tr>
                <th>Duration connection</th>
                <td>{{ (time.connection * 1000)|number_format(0, '', '') }} <small>ms</small> - {{ connection_percent|number_format(0, '', '') }}%</td>
            </tr>
            <tr>
                <th>Duration process</th>
                <td>{{ ((time.total - time.connection) * 1000)|number_format(0, '', '') }} <small>ms</small> - {{ process_percent|number_format(0, '', '') }}%</td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="progress progress-striped">
                        <div class="bar bar-warning" style="width: {{ connection_percent|number_format(0) }}%;">wait {{ connection_percent|number_format(0) }} %</div>
                        <div class="bar bar-success" style="width: {{ process_percent|number_format(0) }}%;">process {{ process_percent|number_format(0) }} %</div>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>

    <h5>Informations</h5>
    <table>
        <tbody>
            <tr>
                <th>Method</th>
                <td>{{ request.method }}</td>
            </tr>
            <tr>
                <th>Protocol</th>
                <td>{{ request.scheme }}</td>
            </tr>
            <tr>
                <th>Host</th>
                <td>{{ request.host }}</td>
            </tr>
            <tr>
                <th>Path</th>
                <td>{{ request.path }}</td>
            </tr>
            <tr>
                <th>Query</th>
                <td>{{ request.query }}</td>
            </tr>
        </tbody>
    </table>

    <h5>Headers</h5>
    <table>
        <tbody>
        {% for header,value in request.headers %}
            <tr>
                <th>{{ header }}</th>
                <td>{{ value|join('<strong>, </strong>') }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <h5>Query Parameters</h5>
    <table>
        <tbody>
        {% for name,parameter in request.query %}
            <tr>
                <th>{{ name }}</th>
                <td>
                    {% if parameter is iterable %}
                        {{ _self.display_array_recursive(parameter) }}
                    {% else %}
                        {{ parameter }}
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    {% if request.body is not empty %}
        <h5>Content</h5>
        <pre class="prettyprint linenums"><code class="language-javascript  ">{{ request.body|replace({"\t\t\n": "", "\t": "  "}) }}</code></pre>
    {% endif %}
</div>
<commit_msg>add a test to avoid a division by zero<commit_after>{% macro display_array_recursive(array, separator = ', ', opening_char = '[', closing_char = ']') -%}
{{ opening_char }}
{%- for key, value in array -%}
    {%- if value is iterable -%}
        {{ key }} => {{ _self.display_array_recursive(value, separator, opening_char, closing_char) }}
    {%- else -%}
        {{ key }} => {{ value }}
        {%- if not loop.last %}{{ separator }}{% endif -%}
    {%- endif -%}
{%- endfor -%}
{{ closing_char }}
{%- endmacro %}

<div id="request_{{ index }}" class="tab-pane active">
    {% if time.total > 0 %}
      {% set connection_percent = (100 * time.connection) / time.total %}
      {% set process_percent = (100 * (time.total - time.connection)) / time.total %}

      <h5>Time</h5>
      <table>
          <tbody>
              <tr>
                  <th>Duration total</th>
                  <td>{{ (time.total * 1000)|number_format(0, '', '') }} <small>ms</small></td>
              </tr>
              <tr>
                  <th>Duration connection</th>
                  <td>{{ (time.connection * 1000)|number_format(0, '', '') }} <small>ms</small> - {{ connection_percent|number_format(0, '', '') }}%</td>
              </tr>
              <tr>
                  <th>Duration process</th>
                  <td>{{ ((time.total - time.connection) * 1000)|number_format(0, '', '') }} <small>ms</small> - {{ process_percent|number_format(0, '', '') }}%</td>
              </tr>
              <tr>
                  <td colspan="2">
                      <div class="progress progress-striped">
                          <div class="bar bar-warning" style="width: {{ connection_percent|number_format(0) }}%;">wait {{ connection_percent|number_format(0) }} %</div>
                          <div class="bar bar-success" style="width: {{ process_percent|number_format(0) }}%;">process {{ process_percent|number_format(0) }} %</div>
                      </div>
                  </td>
              </tr>
          </tbody>
      </table>
    {% endif %}

    <h5>Informations</h5>
    <table>
        <tbody>
            <tr>
                <th>Method</th>
                <td>{{ request.method }}</td>
            </tr>
            <tr>
                <th>Protocol</th>
                <td>{{ request.scheme }}</td>
            </tr>
            <tr>
                <th>Host</th>
                <td>{{ request.host }}</td>
            </tr>
            <tr>
                <th>Path</th>
                <td>{{ request.path }}</td>
            </tr>
            <tr>
                <th>Query</th>
                <td>{{ request.query }}</td>
            </tr>
        </tbody>
    </table>

    <h5>Headers</h5>
    <table>
        <tbody>
        {% for header,value in request.headers %}
            <tr>
                <th>{{ header }}</th>
                <td>{{ value|join('<strong>, </strong>') }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <h5>Query Parameters</h5>
    <table>
        <tbody>
        {% for name,parameter in request.query %}
            <tr>
                <th>{{ name }}</th>
                <td>
                    {% if parameter is iterable %}
                        {{ _self.display_array_recursive(parameter) }}
                    {% else %}
                        {{ parameter }}
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    {% if request.body is not empty %}
        <h5>Content</h5>
        <pre class="prettyprint linenums"><code class="language-javascript  ">{{ request.body|replace({"\t\t\n": "", "\t": "  "}) }}</code></pre>
    {% endif %}
</div>

{'fraction_non_alphanumeric': 0.19029391660970607, 'fraction_numerical': 0.010526315789473684, 'mean_word_length': 1.4394798266088695, 'pattern_counts': {'":': 4, '<': 223, '<?xml version=': 0, '>': 228, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2967213', 'n_tokens_mistral': 2360, 'n_tokens_neox': 2131, 'n_words': 418}