From 1069e623beea0f10b03cf93a45c874709fa0ea5d Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Wed, 25 Mar 2020 14:40:26 +0100 Subject: [PATCH] Add more statistics --- app/helpers/statistics_helper.rb | 12 ++++++++++++ config/locales/de.yml | 2 ++ config/locales/en.yml | 2 ++ 3 files changed, 16 insertions(+) diff --git a/app/helpers/statistics_helper.rb b/app/helpers/statistics_helper.rb index 4b4ac79c..76135219 100644 --- a/app/helpers/statistics_helper.rb +++ b/app/helpers/statistics_helper.rb @@ -68,6 +68,18 @@ module StatisticsHelper unit: '/min', url: statistics_graphs_path }, + { + key: 'autosaves_per_minute', + name: t('statistics.entries.exercises.autosaves_per_minute'), + data: (Submission.where('created_at >= ?', DateTime.now - 1.hours).where(cause: 'autosave').count.to_f / 60).round(2), + unit: '/min' + }, + { + key: 'container_requests_per_minute', + name: t('statistics.entries.exercises.container_requests_per_minute'), + data: (Testrun.where('created_at >= ?', DateTime.now - 1.hours).count.to_f / 60).round(2), + unit: '/min' + }, { key: 'execution_environments', name: t('activerecord.models.execution_environment.other'), diff --git a/config/locales/de.yml b/config/locales/de.yml index 3d847575..6b344365 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -823,6 +823,8 @@ de: exercises: average_number_of_submissions: "Durchschnittliche Zahl von Abgaben" submissions_per_minute: "Aktuelle Abgabenhäufigkeit (1h)" + autosaves_per_minute: "Aktuelle Autosaves (1h)" + container_requests_per_minute: "Aktuelle Containeranfragen (1h)" submissions: "Abgaben" request_for_comments: percent_solved: "Beantwortete Anfragen" diff --git a/config/locales/en.yml b/config/locales/en.yml index aee4ef4a..5547386d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -823,6 +823,8 @@ en: exercises: average_number_of_submissions: "Average Number of Submissions" submissions_per_minute: "Current Submission Volume (1h)" + autosaves_per_minute: "Current Autosave Volume (1h)" + container_requests_per_minute: "Container Request Volume (1h)" submissions: "Submissions" request_for_comments: percent_solved: "Solved Requests"