{% extends "paxalia/base.html" %} {% load static i18n %} {% block page_title %}{% trans "Slow Queries" %}{% endblock %} {% block page_subtitle %}{% trans "Database queries recorded by SlowQueryMiddleware" %}{% endblock %} {% block extra_css %} {% endblock %} {% block dashboard_content %}
{% trans "Threshold" %}{{ slow_query_threshold_ms|default:100 }} ms{% trans "Queries at or above this duration are recorded." %}
{% trans "Recorded" %}{{ slow_queries|length }}{% trans "Recent records shown on this page." %}
{% trans "Capture" %}{% if slow_query_enabled %}{% trans "Active" %}{% else %}{% trans "Not active" %}{% endif %}{% trans "Capture status is determined by dashboard configuration." %}
{% trans "Database" %}{{ database_vendor|default:"unknown" }}{% trans "Current Django database backend." %}

{% trans "Recent Slow Queries" %}

{% if slow_queries %} {% for q in slow_queries %} {% endfor %}
{% trans "Duration" %} {% trans "SQL" %} {% trans "Path" %} {% trans "When" %}
{{ q.duration_ms|floatformat:0 }}ms {{ q.sql|truncatechars:140 }} {{ q.path|default:"—" }} {{ q.created_at|date:"M d, H:i:s" }}
{% else %}
{% trans "No slow queries recorded in the current retention window." %} {% if slow_query_enabled %}{% trans "Capture is enabled. Generate representative application traffic and this view will populate when a query crosses the threshold." %}{% else %}{% trans "Enable slow-query capture in the dashboard middleware configuration to start recording queries." %}{% endif %}
{% endif %}
{% endblock %}