@@ -71,21 +71,21 @@ def exercise_statistics
7171 {
7272 key : 'submissions_per_minute' ,
7373 name : t ( 'statistics.entries.exercises.submissions_per_minute' ) ,
74- data : ( Submission . where ( created_at : DateTime . now - 1 . hour ..) . count . to_f / 60 ) . round ( 2 ) ,
74+ data : ( Submission . where ( created_at : ( DateTime . now - 1 . hour ) ..) . count . to_f / 60 ) . round ( 2 ) ,
7575 unit : '/min' ,
7676 url : statistics_graphs_path ,
7777 } ,
7878 {
7979 key : 'autosaves_per_minute' ,
8080 name : t ( 'statistics.entries.exercises.autosaves_per_minute' ) ,
81- data : ( Submission . where ( created_at : DateTime . now - 1 . hour ..) . where ( cause : 'autosave' ) . count . to_f / 60 ) . round ( 2 ) ,
81+ data : ( Submission . where ( created_at : ( DateTime . now - 1 . hour ) ..) . where ( cause : 'autosave' ) . count . to_f / 60 ) . round ( 2 ) ,
8282 unit : '/min' ,
8383 } ,
8484 {
8585 key : 'container_requests_per_minute' ,
8686 name : t ( 'statistics.entries.exercises.container_requests_per_minute' ) ,
8787 # This query is actually quite expensive since we do not have an index on the created_at column.
88- data : ( Testrun . where ( created_at : DateTime . now - 1 . hour ..) . count . to_f / 60 ) . round ( 2 ) ,
88+ data : ( Testrun . where ( created_at : ( DateTime . now - 1 . hour ) ..) . count . to_f / 60 ) . round ( 2 ) ,
8989 unit : '/min' ,
9090 } ,
9191 {
@@ -118,12 +118,12 @@ def user_activity_live_data
118118 {
119119 key : 'active_in_last_hour' ,
120120 name : t ( 'statistics.entries.contributors.currently_active' ) ,
121- data : Submission . where ( created_at : DateTime . now - 5 . minutes ..) . distinct . select ( :contributor_id , :contributor_type ) . count ,
121+ data : Submission . where ( created_at : ( DateTime . now - 5 . minutes ) ..) . distinct . select ( :contributor_id , :contributor_type ) . count ,
122122 } ,
123123 {
124124 key : 'submissions_per_minute' ,
125125 name : t ( 'statistics.entries.exercises.submissions_per_minute' ) ,
126- data : ( Submission . where ( created_at : DateTime . now - 1 . hour ..) . count . to_f / 60 ) . round ( 2 ) ,
126+ data : ( Submission . where ( created_at : ( DateTime . now - 1 . hour ) ..) . count . to_f / 60 ) . round ( 2 ) ,
127127 unit : '/min' ,
128128 axis : 'right' ,
129129 } ,
0 commit comments