{% extends "_layout.html" %} {% block content %}
{{ macros_page.render_breadcrumbs() }}

{{ vial_current_view.get_view_title() }}


{{ macros_form.render_form_item_datetime(g.search_form.dt_from, 'datetimepicker-from') }}
{{ macros_form.render_form_item_datetime(g.search_form.dt_to, 'datetimepicker-to') }}

{{ _('This module displays various statistics for events. These statistics are calculated from in advance precalculated artefacts and can therefore provide quick overview of event processing.') | safe }}

{%- if searched %} {%- if 'tiid' in request.args %} {{ macros_site.render_timepager(query_params, form_data.dt_from, request.args.tiid) }} {%- endif %} {%- if items %}

{{ _('Result summary') }}

{%- if 'timeline_cfg' in statistics %} {%- endif %} {%- if permission_can('admin') and 'timeline_cfg' in statistics %} {%- endif %}
{{ _('Number of statistical records') }}: {{ babel_format_decimal(items_count) }}
{{ _('Number of events') }}: {{ babel_format_decimal(statistics['count']) }}
{{ _('Result time interval') }}: {{ babel_format_datetime(statistics['dt_from']) }} - {{ babel_format_datetime(statistics['dt_to']) }} ({{ babel_format_timedelta(statistics['dt_to'] - statistics['dt_from']) }})
{{ _('Timeline time interval') }}: {{ babel_format_datetime(statistics['timeline_cfg']['dt_from']) }} - {{ babel_format_datetime(statistics['timeline_cfg']['dt_to']) }} ({{ babel_format_timedelta(statistics['timeline_cfg']['dt_to'] - statistics['timeline_cfg']['dt_from']) }})
{{ get_icon('role-admin') }}{{ _('Timeline steps') }}: {{ babel_format_decimal(statistics['timeline_cfg']['count']) }} x {{ statistics['timeline_cfg']['step'].__str__() }}

{{ _('Comparison of the event counts for overall, internal and external categories:') | safe }}

{{ _('Overall event counts') }}: {{ babel_format_decimal(statistics['stats_overall']['cnt_alerts']) }} {{ babel_format_percent(statistics['stats_overall']['cnt_alerts']/statistics['stats_overall']['cnt_alerts']) }}
{{ _('Internal event counts') }}: {{ babel_format_decimal(statistics['stats_internal']['cnt_alerts']) }} {{ babel_format_percent(statistics['stats_internal']['cnt_alerts']/statistics['stats_overall']['cnt_alerts']) }}
{{ _('External event counts') }}: {{ babel_format_decimal(statistics['stats_external']['cnt_alerts']) }} {{ babel_format_percent(statistics['stats_external']['cnt_alerts']/statistics['stats_overall']['cnt_alerts']) }}

{{ _('Overall processing statistics') }}

{{ _('This panel shows overall statistics calculated from all available data.') | safe }}

{{ _('Total events processed') }}

{{ _('This view shows total numbers of events processed by the Mentat system per day for all networks.') | safe }}

{%- set data_series = [ ['cnt_events', _('events')] ] %} {{ macros_chart.render_chart_timeline_list( statistics['stats_overall'], 'search_result_statistics.stats_overall', 'stats_overall_totals', data_series ) }}
{{ macros_chart.render_dashboard_panels( statistics['stats_overall'], 'search_result_statistics.stats_overall', 'stats-overall', cfg_params = { 'kwargs': { 'dt_from': statistics.get('dt_from', None), 'dt_to': statistics.get('dt_to', None) } } ) }}

{{ _('Internal processing statistics') }}

{{ _('This panel shows statistics calculated only for data regarding internal networks. The internal networks are those that are registered within the Mentat system, because they are important and interesting to the system users.') | safe }}

{{ _('Total events processed') }}

{{ _('This view shows total numbers of events processed by the Mentat system per day for internal networks.') | safe }}

{%- set data_series = [ ['cnt_events', _('events')] ] %} {{ macros_chart.render_chart_timeline_list( statistics['stats_internal'], 'search_result_statistics.stats_internal', 'stats_internal_totals', data_series ) }}
{{ macros_chart.render_dashboard_panels( statistics['stats_internal'], 'search_result_statistics.stats_internal', 'stats-internal', cfg_params = { 'kwargs': { 'dt_from': statistics.get('dt_from', None), 'dt_to': statistics.get('dt_to', None) } } ) }}

{{ _('External processing statistics') }}

{{ _('This panel shows statistics calculated only for data regarding external networks. The external networks are those that are not registered within the Mentat system and are therefore not that important or interesting to the system users.') | safe }}

{{ _('Total events processed') }}

{{ _('This view shows total numbers of events processed by the Mentat system per day for external networks.') | safe }}

{%- set data_series = [ ['cnt_events', _('events')] ] %} {{ macros_chart.render_chart_timeline_list( statistics['stats_external'], 'search_result_statistics.stats_external', 'stats_external_totals', data_series ) }}
{{ macros_chart.render_dashboard_panels( statistics['stats_external'], 'search_result_statistics.stats_external', 'stats-external', hide_sections = ['abuses'], cfg_params = { 'kwargs': { 'dt_from': statistics.get('dt_from', None), 'dt_to': statistics.get('dt_to', None) } } ) }}
{%- if permission_can('developer') %}
{{ macros_site.render_raw_var('statistics', statistics) }} {%- endif %} {%- else %} {%- call macros_site.render_alert('warning', False) %} {{ _('No data matches your search criteria.') }} {%- endcall %} {%- endif %} {%- endif %} {%- if permission_can('developer') %}
{{ macros_site.render_raw_var('request_args', request.args) }} {{ macros_site.render_raw_var('form_data', form_data) }} {{ macros_site.render_raw_var('query_params', query_params) }} {%- endif %} {%- endblock content %}