Skip to content

Commit f270cc2

Browse files
committed
Add more data to status page
1 parent 04a059f commit f270cc2

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

app/controllers/status_controller.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
class StatusController < ApplicationController
55
def index
66
authorize! :read_instance_state, nil
7+
@high_priority_submissions_count = Submission.to_be_reprocessed.where(processing_priority: 0).count
78
@sandbox_queue_length = Submission.to_be_reprocessed.count
89
@unprocessed_submissions_count = Submission.where(processed: false).count
9-
@submissions_count = Submission.where(created_at: Time.current.all_day).count
10+
@submissions_count_minute = Submission.where(created_at: (Time.current - 1.minute)..Time.current).count
11+
@submissions_count_five_minutes = Submission.where(created_at: (Time.current - 5.minute)..Time.current).count
12+
@submissions_count_hour = Submission.where(created_at: (Time.current - 1.hour)..Time.current).count
13+
@submissions_count_today = Submission.where(created_at: Time.current.all_day).count
14+
@submissions_count_yesterday = Submission.where(created_at: Time.current.yesterday.all_day).count
1015
@submissions_count_week = Submission.where(created_at: Time.current.all_week).count
1116
@sandboxes = RemoteSandbox.all + RemoteSandbox.all_experimental
1217
end

app/views/status/index.html.erb

+22-2
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,36 @@
99
<table class="table">
1010
<tbody>
1111
<tr>
12-
<th scope="row">Submission queue </th scope="row">
12+
<th scope="row">High priority sumbmissions in queue </th scope="row">
13+
<td><%= @high_priority_submissions_count %></td>
14+
</tr>
15+
<tr>
16+
<th scope="row">All submissions in queue</th scope="row">
1317
<td><%= @sandbox_queue_length %></td>
1418
</tr>
1519
<tr>
1620
<th scope="row">Submissions, processing not complete</th>
1721
<td><%= @unprocessed_submissions_count %></td>
1822
</tr>
23+
<tr>
24+
<th scope="row">Submissions during the last minute</th>
25+
<td><%= @submissions_count_minute %></td>
26+
</tr>
27+
<tr>
28+
<th scope="row">Submissions during the last five minutes</th>
29+
<td><%= @submissions_count_five_minutes %></td>
30+
</tr>
31+
<tr>
32+
<th scope="row">Submissions during the latest hour</th>
33+
<td><%= @submissions_count_hour %></td>
34+
</tr>
1935
<tr>
2036
<th scope="row">Submissions today</th>
21-
<td><%= @submissions_count %></td>
37+
<td><%= @submissions_count_today %></td>
38+
</tr>
39+
<tr>
40+
<th scope="row">Submissions yesterday</th>
41+
<td><%= @submissions_count_yesterday %></td>
2242
</tr>
2343
<tr>
2444
<th scope="row">Submissions this week</th>

0 commit comments

Comments
 (0)