{% from "leeuwenhoek/_macros.html" import duration, time_ago %} {% macro error_tag(err) %}{% if err %}{{ err['class'].split('.')[-1] }}{% endif %}{% endmacro %} {% macro command_tag(c) %}{{ c.command }}{% if c.command == "PIPELINE" %} {{ c.count }} command{{ 's' if c.count != 1 }}{% endif %}{% endmacro %} {% macro args_text(c) %}{% if c.command == "PIPELINE" %}{{ c.commands | map(attribute='command') | join(", ") }}{% else %}{{ c.args | join(" ") }}{% endif %}{% endmacro %} {% macro head() %}
{{ args_text(e.content) | lw_truncate(90) }}{{ args_text(e.content) | lw_truncate(90) }} {{ error_tag(e.content.error) }} {{ duration(e.content.duration_ms) }}{% endmacro %}
{% macro arg_list(c) -%}
{%- for a in c.args %}{{ a }} {% endfor -%}
{%- if c.args_omitted %}… {{ c.args_omitted }} more{% endif -%}
{%- endmacro %}
{% macro detail(e) %}
{% set c = e.content %}
Command
{{ c.command }}
Duration
{{ c.duration_ms | lw_duration }}
Server
{{ c.host or '—' }}
Database
{{ c.db if c.db is not none else '—' }}
Client
{{ 'async' if c['async'] else 'sync' }}
{{ c.count }} command{{ 's' if c.count != 1 }}{% if c.transaction %} in a transaction (MULTI / EXEC){% endif %}
| # | Command | Arguments |
|---|---|---|
| {{ loop.index }} | {{ cmd.command }} {{ error_tag(cmd.error) }} | {{ arg_list(cmd) }} |
… {{ c.commands_omitted }} more commands not recorded
{% endif %} {% else %}Arguments
{% if c.args %}{{ arg_list(c) }}{% else %}none{% endif %}
{% endif %} {% endmacro %}