{%- if query_status_events %}
{{ _('PID') }}
|
{{ _('Name') }}
|
{{ _('Owner') }}
|
{{ _('State') }}
|
{{ _('Start time') }}
|
{{ _('Duration') }}
|
{{ _('Query') }}
|
{{ get_icon('actions') }}
|
{%- for query_data in query_status_events %}
{{ query_data.pid }}
|
{% if 'query_name' in query_data and query_data.query_name %}
{{ query_data.query_name }}
|
{{
macros_site.render_endpoint_link(
'users.show',
params = {'item_id': query_data.user_id, 'item': query_data.user},
label = query_data.user.fullname,
with_icon = True
)
}}
|
{% else %}
---
|
---
|
{% endif %}
{{ query_data.state }}
|
{% if 'query_start' in query_data and query_data.query_start %}
{{ babel_format_datetime(query_data.query_start) }}
|
{{ babel_format_timedelta(get_datetime_utc(aware = True) - query_data.query_start) }}
|
{% else %}
---
|
---
|
{% endif %}
{% if 'query' in query_data and query_data.query %}
{{ query_data.query|truncate(100) }}
|
{% else %}
---
|
{% endif %}
{% if 'query_name' in query_data and query_data.query_name %}
{{
macros_page.render_menu_context_actions(
query_data,
action_menu = context_action_menu_query
)
}}
|
{% else %}
---
|
{% endif %}
{%- endfor %}
{%- else %}
{%- call macros_site.render_alert('info', False) %}
{{ _('There are currently no running user queries.') }}
{%- endcall %}
{%- endif %}
{#- Reference for this hack: https://stackoverflow.com/a/11842865 -#}
{{ _('List of available tables:') }}
{%- for table_name, table_data in database_status_events['tables'] | dictsort %}
{{ table_name }}
{%- endfor %}
{%- for table_name, table_data in database_status_events['tables'] | dictsort %}
{#- Reference for this hack: https://stackoverflow.com/a/11842865 -#}
{{ _('Table %(table_name)s', table_name = table_name) }}
{{ get_icon('backtotop') }}
{{ _('Estimated number of records:') }}
|
{%- if table_data['row_estimate'] %}
{{ babel_format_decimal(table_data['row_estimate']) }}
{%- else %}
{{ table_data['row_estimate'] }}
{%- endif %}
|
{{ _('Table size:') }}
|
{{ table_data['table_bytes_str'] }} ({{ babel_format_percent(table_data['table_bytes'] / table_data['total_bytes']) }})
|
{{ _('Index size:') }}
|
{{ table_data['index_bytes_str'] }} ({{ babel_format_percent(table_data['index_bytes'] / table_data['total_bytes']) }})
|
{{ _('Tablespace size:') }}
|
{{ table_data['toast_bytes_str'] }} ({{ babel_format_percent(table_data['toast_bytes'] / table_data['total_bytes']) }})
|
{{ _('Total size:') }}
|
{{ table_data['total_bytes_str'] }} ({{ babel_format_percent(table_data['total_bytes'] / table_data['total_bytes']) }})
|
{{ _('Oldest record:') }}
|
{%- if 'dt_oldest' in table_data and table_data['dt_oldest'] %}
{{ babel_format_datetime(table_data['dt_oldest']) }} ({{ gettext('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - table_data['dt_oldest'])) }})
{%- else %}
{{ _('unknown') }}
{%- endif %}
|
{{ _('Newest record:') }}
|
{%- if 'dt_newest' in table_data and table_data['dt_newest'] %}
{{ babel_format_datetime(table_data['dt_newest']) }} ({{ gettext('%(delta)s ago', delta = babel_format_timedelta(current_datetime_utc - table_data['dt_newest'])) }})
{%- else %}
{{ _('unknown') }}
{%- endif %}
|
{{ _('Record timespan:') }}
|
{%- if 'dt_oldest' in table_data and table_data['dt_oldest'] and 'dt_newest' in table_data and table_data['dt_newest']%}
{{ babel_format_timedelta(table_data['dt_newest'] - table_data['dt_oldest']) }}
{%- else %}
{{ _('unknown') }}
{%- endif %}
|
{{ table_data['table_bytes_str'] }}
{{ table_data['index_bytes_str'] }}
{% if not loop.last %}
{% endif %}
{%- endfor %}
{%- for chsection in chsections %}
{{ chsection['label'] }}
{{ macros_chart.render_dataset_pie_dict(
database_statistics_events,
'database_statistics_events',
'database_events',
chsection['ident'],
{
'value_label': chsection['value_label'],
'value_format': chsection['value_format']
}
)
}}
{%- endfor %}