{% extends "server/base.html" %} {% set short = ref(agent.id) %} {% block title %}{{ t.text("activity.usage.title") }}{% endblock %} {% block top %}{% endblock %} {% block head %}{% endblock %} {% block body %} {# today's tokens - fresh input, cache hits and output - what they cost where the runtime says, the hits as a share of what was read, and a bar an hour of the viewer's day, each against the busiest; an hour without any is a stub, the hour now coloured #} {% set fresh = hours | sum(attribute="input") %} {% set cached = hours | sum(attribute="cached") %} {% set spent = hours | rejectattr("cost", "none") | map(attribute="cost") | list %}

{{ t.text("activity.usage.title") }}

{{ t.text("activity.usage.hourly") }}
{{ (fresh + cached + hours | sum(attribute="output")) | tokens }}tokens{% if spent %} · ${{ "%.2f" | format(spent | sum) }}{% endif %} · {{ t.text("activity.hits") }} {{ ((cached * 100 / (fresh + cached)) | round | int) if fresh + cached else 0 }}%
{% for hour in hours %} {% set used = hour.input + hour.cached + hour.output %} {% endfor %}
0006121824
{% endblock %}