Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,15 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.4)
rubocop (1.76.1)
rubocop (1.76.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.45.0, < 2.0)
rubocop-ast (>= 1.45.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.45.1)
Expand Down Expand Up @@ -942,7 +942,7 @@ CHECKSUMS
rspec-mocks (3.13.5) sha256=e4338a6f285ada9fe56f5893f5457783af8194f5d08884d17a87321d5195ea81
rspec-rails (8.0.1) sha256=0c3700b10ab6d7c648c4cd554023d8c2b5b07e7f01205f7608f0c511cf686505
rspec-support (3.13.4) sha256=184b1814f6a968102b57df631892c7f1990a91c9a3b9e80ef892a0fc2a71a3f7
rubocop (1.76.1) sha256=e15a2d750794cf2157d2de8b1b403dfa71b8dc3957a22ae6043b1bdf21e7e0e7
rubocop (1.76.2) sha256=ae44f172ba0bbe3d623c927111798f85a7879bcc88e544d08f51f62c19f45633
rubocop-ast (1.45.1) sha256=94042e49adc17f187ba037b33f941ba7398fede77cdf4bffafba95190a473a3e
rubocop-capybara (2.22.1) sha256=ced88caef23efea53f46e098ff352f8fc1068c649606ca75cb74650970f51c0c
rubocop-factory_bot (2.27.1) sha256=9d744b5916778c1848e5fe6777cc69855bd96548853554ec239ba9961b8573fe
Expand Down
10 changes: 5 additions & 5 deletions app/helpers/statistics_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ def exercise_statistics
{
key: 'submissions_per_minute',
name: t('statistics.entries.exercises.submissions_per_minute'),
data: (Submission.where(created_at: DateTime.now - 1.hour..).count.to_f / 60).round(2),
data: (Submission.where(created_at: (DateTime.now - 1.hour)..).count.to_f / 60).round(2),
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.hour..).where(cause: 'autosave').count.to_f / 60).round(2),
data: (Submission.where(created_at: (DateTime.now - 1.hour)..).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'),
# This query is actually quite expensive since we do not have an index on the created_at column.
data: (Testrun.where(created_at: DateTime.now - 1.hour..).count.to_f / 60).round(2),
data: (Testrun.where(created_at: (DateTime.now - 1.hour)..).count.to_f / 60).round(2),
unit: '/min',
},
{
Expand Down Expand Up @@ -118,12 +118,12 @@ def user_activity_live_data
{
key: 'active_in_last_hour',
name: t('statistics.entries.contributors.currently_active'),
data: Submission.where(created_at: DateTime.now - 5.minutes..).distinct.select(:contributor_id, :contributor_type).count,
data: Submission.where(created_at: (DateTime.now - 5.minutes)..).distinct.select(:contributor_id, :contributor_type).count,
},
{
key: 'submissions_per_minute',
name: t('statistics.entries.exercises.submissions_per_minute'),
data: (Submission.where(created_at: DateTime.now - 1.hour..).count.to_f / 60).round(2),
data: (Submission.where(created_at: (DateTime.now - 1.hour)..).count.to_f / 60).round(2),
unit: '/min',
axis: 'right',
},
Expand Down
10 changes: 5 additions & 5 deletions app/models/event/synchronized_editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@
event.presence if event.present? # TODO: As of now, we are storing the `session_id` most of the times. Intended?
end
private_class_method :data_attribute
end

private
private

def lines_not_nil
if lines.nil?
errors.add(:lines, 'cannot be nil')
def lines_not_nil
if lines.nil?
errors.add(:lines, 'cannot be nil')

Check warning on line 99 in app/models/event/synchronized_editor.rb

View check run for this annotation

Codecov / codecov/patch

app/models/event/synchronized_editor.rb#L98-L99

Added lines #L98 - L99 were not covered by tests
end
end
end