Commit 3604204b authored by carlosribas's avatar carlosribas
Browse files

Show high priority searches

parent 2803b1f8
......@@ -30,25 +30,29 @@ limitations under the License.
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Number of searches</th>
<th scope="col">Average search time</th>
<th scope="col" class="text-center">Number of searches</th>
<th scope="col" class="text-center">Average search time</th>
<th scope="col" class="text-center">Average search time (high priority)</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">All searches</th>
<td><span class="badge">{{ context.all_searches }}</span></td>
<td><span class="badge">{{ context.average_all_searches }}</span></td>
<td class="text-center"><span class="badge">{{ context.all_searches }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_all_searches }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_high_priority_searches }}</span></td>
</tr>
<tr>
<th scope="row">Last 24 hours</th>
<td><span class="badge">{{ context.searches_last_24_hours }}</span></td>
<td><span class="badge">{{ context.average_last_24_hours }}</span></td>
<td class="text-center"><span class="badge">{{ context.searches_last_24_hours }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_last_24_hours }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_last_24_hours_high_priority }}</span></td>
</tr>
<tr>
<th scope="row">Last 7 days</th>
<td><span class="badge">{{ context.searches_last_week }}</span></td>
<td><span class="badge">{{ context.average_last_week }}</span></td>
<td class="text-center"><span class="badge">{{ context.searches_last_week }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_last_week }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_last_week_high_priority }}</span></td>
</tr>
</tbody>
</table>
......
......@@ -11,6 +11,9 @@ class SequenceSearchTest(TestCase):
"all_searches_result": {"count": 14602, "avg_time": "0:01:10"},
"last_24_hours_result": {"count": 118, "avg_time": "0:04:07"},
"last_week_result": {"count": 896, "avg_time": "0:00:46"},
"high_priority_result": {"count": 9037, "avg_time": "0:00:40"},
"high_priority_24_hours_result": {"count": 735, "avg_time": "0:00:31"},
"high_priority_last_week_result": {"count": 702, "avg_time": "0:00:42"},
"searches_per_month": [],
"expert_db_results": [{"RNAcentral": []}, {"Rfam": []}, {"miRBase": []}, {"snoDB": []}, {"GtRNAdb": []}]
}
......
......@@ -121,6 +121,7 @@ def dashboard(request):
"""Info about searches in rnacentral-sequence-search."""
all_searches, searches_last_24_hours, searches_last_week = 0, 0, 0
average_all_searches, average_last_24_hours, average_last_week = 0, 0, 0
average_high_priority_searches, average_last_24_hours_high_priority, average_last_week_high_priority = 0, 0, 0
searches_per_month = None
expert_db_results = None
show_searches_url = SEQUENCE_SEARCH_ENDPOINT + '/api/show-searches'
......@@ -132,10 +133,13 @@ def dashboard(request):
all_searches = data['all_searches_result']['count']
average_all_searches = data['all_searches_result']['avg_time']
average_high_priority_searches = data['high_priority_result']['avg_time']
searches_last_24_hours = data['last_24_hours_result']['count']
average_last_24_hours = data['last_24_hours_result']['avg_time']
average_last_24_hours_high_priority = data['high_priority_24_hours_result']['avg_time']
searches_last_week = data['last_week_result']['count']
average_last_week = data['last_week_result']['avg_time']
average_last_week_high_priority = data['high_priority_last_week_result']['avg_time']
searches_per_month = data['searches_per_month']
expert_db_results = data['expert_db_results']
......@@ -173,6 +177,9 @@ def dashboard(request):
'average_all_searches': average_all_searches,
'average_last_24_hours': average_last_24_hours,
'average_last_week': average_last_week,
'average_high_priority_searches': average_high_priority_searches,
'average_last_24_hours_high_priority': average_last_24_hours_high_priority,
'average_last_week_high_priority': average_last_week_high_priority,
'searches_per_month': searches_per_month,
'expert_db_results': expert_db_results,
'current_month_pie_chart': current_month_pie_chart,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment