{% with session_statistics = context.get_session_statistics(), logged_download_statistics = context.get_logged_download_statistics(), manifest_information = context.get_manifest_download_statistics() %}
Number of sessions: {{ session_statistics.count }}
Total duration: {{ session_statistics.sum }}
Mean duration: {{ session_statistics.mean }}
Median duration: {{ session_statistics.median }}



Number of downloads: {{ logged_download_statistics.count }}
Total size: {{ logged_download_statistics.sum|filesizeformat }}
Mean size: {{ logged_download_statistics.mean|filesizeformat }}
Geometric mean size: {{ logged_download_statistics.gmean|filesizeformat }}
Median size: {{ logged_download_statistics.median|filesizeformat }}


{% set manifest_statistics = manifest_information.statistics %}
Number of manifests: {{ manifest_statistics.count }}
Total size: {{ manifest_statistics.sum|filesizeformat }}
Mean size: {{ manifest_statistics.mean|filesizeformat }}
Geometric mean size: {{ manifest_statistics.gmean|filesizeformat }}
Median size: {{ manifest_statistics.median|filesizeformat }}


{# This forces all digits to have the same width. I think it stands for "tabular numbers". #}
{% for table in manifest_information['tables'] %} {% set key_count = table.headers | length %} {% set key_columns = 6 %} {% set data_columns = 4 %} {% set key_column_span = key_columns // key_count %} {% if not loop.first %} {% endif %} {% for header in table.headers %} {% endfor %} {% for row in table.lines %} {% for key in row.key %} {% endfor %} {% endfor %} {% endfor %}
 
Key Manifest OPUS ID File Path
{{ header }}Count Count Count Size (MB)
{{ key }}{{ "{:,d}".format(row.manifest_count) }} {{ "{:,d}".format(row.opus_id_count) }} {{ "{:,d}".format(row.file_path_count) }} {{ "{:,.2f}".format(row.file_path_bytes / 1000000.0) }}
Total {{ "{:,d}".format(table.total.file_path_count) }} {{ "{:,.2f}".format(table.total.file_path_bytes / 1000000.0) }}
Number of manifest files: {{ "{:,d}".format(manifest_information['manifest_count']) }}
Number of distinct OPUS IDs: {{ "{:,d}".format(manifest_information['opus_id_count']) }}
{% endwith %}