{%- for table_name, table_data in database_status_events['tables'] | dictsort %}
{{ gettext('Estimated number of records:') }}
|
{%- if table_data['row_estimate'] %}
{{ babel_format_decimal(table_data['row_estimate']) }}
{%- else %}
{{ table_data['row_estimate'] }}
{%- endif %}
|
{{ gettext('Table size:') }}
|
{{ table_data['table_bytes_str'] }} ({{ babel_format_percent(table_data['table_bytes'] / table_data['total_bytes']) }})
|
{{ gettext('Index size:') }}
|
{{ table_data['index_bytes_str'] }} ({{ babel_format_percent(table_data['index_bytes'] / table_data['total_bytes']) }})
|
{{ gettext('Tablespace size:') }}
|
{{ table_data['toast_bytes_str'] }} ({{ babel_format_percent(table_data['toast_bytes'] / table_data['total_bytes']) }})
|
{{ gettext('Total size:') }}
|
{{ table_data['total_bytes_str'] }} ({{ babel_format_percent(table_data['total_bytes'] / table_data['total_bytes']) }})
|
{{ gettext('Oldest record:') }}
|
{%- if 'dt_oldest' in table_data and table_data['dt_oldest'] %}
{{ babel_format_datetime(table_data['dt_oldest']) }} ({{ gettext('before') }} {{ babel_format_timedelta(current_datetime_utc - table_data['dt_oldest']) }})
{%- else %}
{{ gettext('unknown') }}
{%- endif %}
|
{{ gettext('Newest record:') }}
|
{%- if 'dt_newest' in table_data and table_data['dt_newest'] %}
{{ babel_format_datetime(table_data['dt_newest']) }} ({{ gettext('before') }} {{ babel_format_timedelta(current_datetime_utc - table_data['dt_newest']) }})
{%- else %}
{{ gettext('unknown') }}
{%- endif %}
|
{{ gettext('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 %}
{{ gettext('unknown') }}
{%- endif %}
|
{% endif %}
{%- endfor %}
{%-
for chsection in [
{'ident': 'row_estimate', 'label': gettext('Row counts'), 'value_label': False, 'value_unit': False, 'value_format': False},
{'ident': 'total_bytes', 'label': gettext('Total sizes'), 'value_label': gettext('Size in bytes'), 'value_unit': gettext('Size'), 'value_format': babel_format_bytes},
{'ident': 'table_bytes', 'label': gettext('Table sizes'), 'value_label': gettext('Size in bytes'), 'value_unit': gettext('Size'), 'value_format': babel_format_bytes},
{'ident': 'index_bytes', 'label': gettext('Index sizes'), 'value_label': gettext('Size in bytes'), 'value_unit': gettext('Size'), 'value_format': babel_format_bytes}
]
%}
{{ macros_site.render_chart_pie(
'database_events',
database_statistics_events,
chsection['ident'],
chsection['label'],
value_label = chsection['value_label'],
value_unit = chsection['value_unit'],
value_format = chsection['value_format']
)
}}
{%- endfor %}