Skip to content

Commit

Permalink
Add more data to status page
Browse files Browse the repository at this point in the history
  • Loading branch information
nygrenh committed Dec 28, 2018
1 parent 04a059f commit 888b050
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app/controllers/status_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
class StatusController < ApplicationController
def index
authorize! :read_instance_state, nil
@high_priority_submissions_count = Submission.to_be_reprocessed.where(processing_priority: 0).count
@sandbox_queue_length = Submission.to_be_reprocessed.count
@unprocessed_submissions_count = Submission.where(processed: false).count
@submissions_count = Submission.where(created_at: Time.current.all_day).count
@submissions_count_minute = Submission.where(created_at: (Time.current - 1.minute)..Time.current).count
@submissions_count_five_minutes = Submission.where(created_at: (Time.current - 5.minute)..Time.current).count
@submissions_count_hour = Submission.where(created_at: (Time.current - 1.hour)..Time.current).count
@submissions_count_today = Submission.where(created_at: Time.current.all_day).count
@submissions_count_yesterday = Submission.where(created_at: Time.current.yesterday.all_day).count
@submissions_count_week = Submission.where(created_at: Time.current.all_week).count
@sandboxes = RemoteSandbox.all + RemoteSandbox.all_experimental
end
Expand Down
24 changes: 22 additions & 2 deletions app/views/status/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,36 @@
<table class="table">
<tbody>
<tr>
<th scope="row">Submission queue </th scope="row">
<th scope="row">High priority submissions in queue </th scope="row">
<td><%= @high_priority_submissions_count %></td>
</tr>
<tr>
<th scope="row">All submissions in queue</th scope="row">
<td><%= @sandbox_queue_length %></td>
</tr>
<tr>
<th scope="row">Submissions, processing not complete</th>
<td><%= @unprocessed_submissions_count %></td>
</tr>
<tr>
<th scope="row">Submissions during the last minute</th>
<td><%= @submissions_count_minute %></td>
</tr>
<tr>
<th scope="row">Submissions during the last five minutes</th>
<td><%= @submissions_count_five_minutes %></td>
</tr>
<tr>
<th scope="row">Submissions during the latest hour</th>
<td><%= @submissions_count_hour %></td>
</tr>
<tr>
<th scope="row">Submissions today</th>
<td><%= @submissions_count %></td>
<td><%= @submissions_count_today %></td>
</tr>
<tr>
<th scope="row">Submissions yesterday</th>
<td><%= @submissions_count_yesterday %></td>
</tr>
<tr>
<th scope="row">Submissions this week</th>
Expand Down

0 comments on commit 888b050

Please sign in to comment.