{% load i18n %}

⚡ {% trans "Activity" %}

pg_stat_activity {% trans "— running queries and connections" %}

{% include "partials/_banner.html" %} {% if headroom %}

{% trans "Connections" %} {% trans "— in use vs the server limit" %}

{% blocktrans with used=headroom.used max=headroom.max %}{{ used }} / {{ max }} used{% endblocktrans %} · {{ headroom.pct }}%

{% blocktrans with n=headroom.available %}{{ n }} available{% endblocktrans %} {% if headroom.reserved %} {% blocktrans with n=headroom.reserved %}{{ n }} reserved for superusers{% endblocktrans %} {% endif %} {% if headroom.by_state %} {% for state, count in headroom.by_state.items %} {{ state }}: {{ count }} {% endfor %} {% endif %}
{% endif %} {% if xmin_holder %}

{% trans "Oldest snapshot in use" %} {% trans "— rows updated or deleted since then can't be vacuumed" %}

{% blocktrans with pid=xmin_holder.pid user=xmin_holder.user|default:"—" age=xmin_holder.xmin_age %}PID {{ pid }} ({{ user }}) is looking at the database as it was {{ age }} transactions ago{% endblocktrans %} · {{ xmin_holder.state|default:"—" }}

{% if xmin_holder.pins_vacuum %}

{% trans "It is not running a query, so nothing needs that old view. Cancel does nothing here; ending the session lets VACUUM clean up." %}

{% endif %}
{% endif %} {% if sessions %}
{% for s in sessions %} {% endfor %}
PID {% trans "User" %} {% trans "State" %} {% trans "Running" %} xmin age {% trans "Query" %} {% trans "Actions" %}
{{ s.pid }} {{ s.user|default:"—" }} {% if s.state == 'active' %} {% trans "active" %} {% elif s.state == 'idle in transaction' %} {% trans "idle in txn" %} {% else %} {{ s.state|default:"—" }} {% endif %} {% if s.blocked %} {% blocktrans with pids=s.blocked_by|join:", " %}blocked by {{ pids }}{% endblocktrans %} {% endif %} {% if s.wait %}{{ s.wait }}{% endif %} {% if s.state == 'active' and s.query_secs is not None %}{{ s.query_secs }}s{% else %}—{% endif %} {% if s.xmin_age is not None %}{{ s.xmin_age }}{% else %}—{% endif %} {% if s.is_self %}{% trans "— cli2ui (this request) —" %}{% else %}{{ s.query|default:"—" }}{% endif %} {% if s.is_self %} {% trans "this tool" %} {% else %} {% if s.cancellable %} {% else %} {# Not running a query: cancel would be accepted and do nothing. #} {% trans "cancel" %} {% endif %} {% endif %}
{% blocktrans count n=sessions|length %}{{ n }} client session · cancel stops the query, kill drops the connection{% plural %}{{ n }} client sessions · cancel stops the query, kill drops the connection{% endblocktrans %}
{% else %}

{% trans "No client sessions" %}

{% trans "Nothing is connected to this database right now." %}

{% endif %}

{% trans "The query behind this view" %}

{{ query_sql }}