Link to live graphs from statistics overview page

This commit is contained in:
Maximilian Grundke
2018-04-11 14:33:04 +02:00
parent 24f693d5b1
commit f2e6d430a9

View File

@ -39,7 +39,8 @@ module StatisticsHelper
name: t('statistics.entries.users.currently_active'),
data: ExternalUser.joins(:submissions)
.where(['submissions.created_at >= ?', DateTime.now - 5.minutes])
.distinct('external_users.id').count
.distinct('external_users.id').count,
url: 'statistics/graphs'
}
]
end
@ -61,7 +62,8 @@ module StatisticsHelper
key: 'submissions_per_minute',
name: t('statistics.entries.exercises.submissions_per_minute'),
data: (Submission.where('created_at >= ?', DateTime.now - 1.hours).count.to_f / 60).round(2),
unit: '/min'
unit: '/min',
url: 'statistics/graphs'
},
{
key: 'execution_environments',