Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Carlos Ribas
rnacentral-webcode
Commits
3604204b
Commit
3604204b
authored
Aug 25, 2021
by
carlosribas
Browse files
Show high priority searches
parent
2803b1f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
8 deletions
+22
-8
rnacentral/sequence_search/templates/dashboard.html
rnacentral/sequence_search/templates/dashboard.html
+12
-8
rnacentral/sequence_search/tests.py
rnacentral/sequence_search/tests.py
+3
-0
rnacentral/sequence_search/views.py
rnacentral/sequence_search/views.py
+7
-0
No files found.
rnacentral/sequence_search/templates/dashboard.html
View file @
3604204b
...
...
@@ -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>
...
...
rnacentral/sequence_search/tests.py
View file @
3604204b
...
...
@@ -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"
:
[]}]
}
...
...
rnacentral/sequence_search/views.py
View file @
3604204b
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment