{% from "leeuwenhoek/_macros.html" import duration, time_ago, json_tree %} {% macro result_tag(c) -%} {%- if c.hit is defined and c.hit is not none -%} {%- if c.hit %}hit{% else %}miss{% endif -%} {%- elif c.hits is defined -%} {{ c.hits }} hits {{ c.misses }} misses {%- endif -%} {%- endmacro %} {% macro keys(c, length=80) %}{% if c.operation == "clear" %}all keys{% else %}{{ c['keys'] | join(", ") | lw_truncate(length) }}{% endif %}{% endmacro %} {% macro head() %}OperationKeysResultDurationWhen{% endmacro %} {% macro row(e) %} {{ e.content.operation }} {{ keys(e.content) }} {{ result_tag(e.content) }} {{ duration(e.content.duration_ms) }} {{ time_ago(e.created_at) }} {% endmacro %} {% macro summary(e) %}{{ e.content.operation }} {{ keys(e.content, 100) }} {{ result_tag(e.content) }}{% endmacro %} {% macro detail(e) %} {% set c = e.content %}

{{ c.operation }} {{ result_tag(c) }} {{ c.duration_ms | lw_duration }} {%- if c.backend %} ยท {{ c.backend }}{% endif %}

{% if c.timeout is defined %}{% endif %} {% if c.result is defined and c.result is not none %}{% endif %}
Keys{% if c.operation == "clear" %}all keys{% else %}{% for k in c['keys'] %}{{ k }}{% if not loop.last %}
{% endif %}{% endfor %}{% endif %}
TTL{% if c.timeout is none %}backend default{% elif c.timeout == 0 %}never expires{% else %}{{ c.timeout }} s{% endif %}
Result{{ c.result | tojson }}
{% if c.get('values') %}

Values

{{ json_tree(c.get('values'), true) }}{% endif %} {% endmacro %}