Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3mon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carlo Guidi
km3mon
Commits
a2ab81d2
Commit
a2ab81d2
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Add top10g
parent
9a42351b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/routes.py
+22
-0
22 additions, 0 deletions
app/routes.py
app/templates/top10.html
+20
-0
20 additions, 0 deletions
app/templates/top10.html
with
42 additions
and
0 deletions
app/routes.py
+
22
−
0
View file @
a2ab81d2
...
...
@@ -6,6 +6,8 @@ import toml
from
flask
import
render_template
,
send_from_directory
,
request
,
Response
from
app
import
app
from
km3modules.common
import
LocalDBService
CONFIG_PATH
=
"
pipeline.toml
"
PLOTS_PATH
=
"
../plots
"
LOGS_PATH
=
"
../logs
"
...
...
@@ -164,6 +166,26 @@ def trigger():
return
render_template
(
'
plots.html
'
,
plots
=
expand_wildcards
(
TRIGGER_PLOTS
))
@app.route
(
'
/top10.html
'
)
@requires_auth
def
top10
():
category_names
=
{
'
n_hits
'
:
'
Number of hits
'
,
'
overlays
'
:
'
Number of overlays
'
}
plots
=
{}
dbs
=
LocalDBService
(
filename
=
"
data/monitoring.sqlite3
"
)
for
category
in
[
"
overlays
"
,
"
n_hits
"
]:
filenames
=
[
q
[
0
]
for
q
in
dbs
.
query
(
"
SELECT plot_filename FROM event_selection
"
"
ORDER BY {} DESC LIMIT 10
"
.
format
(
category
))
]
if
len
(
filenames
)
>
0
:
plots
[
category_names
[
category
]]
=
filenames
return
render_template
(
'
top10.html
'
,
plots
=
plots
)
@app.route
(
'
/logs.html
'
)
@requires_auth
def
logs
():
...
...
This diff is collapsed.
Click to expand it.
app/templates/top10.html
0 → 100644
+
20
−
0
View file @
a2ab81d2
{% extends "base.html" %}
{% block main %}
{% for category, plot_filenames in plots %}
<h3>
{{ category }}
</h3>
<div
class=
"container-fluid"
>
<div
class=
"row"
>
{% for plot_filename in plot_filenames %}
<div
class=
"col-md-12"
>
<img
class=
"plot img-responsive"
src=
"{{ plot_filename }}"
alt=
"{{ plot_filename }}"
/>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
{% endblock %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment