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
26a4386b
Commit
26a4386b
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Add meta data to top10 events
parent
340990c2
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
+12
-9
12 additions, 9 deletions
app/routes.py
app/templates/top10.html
+5
-5
5 additions, 5 deletions
app/templates/top10.html
with
17 additions
and
14 deletions
app/routes.py
+
12
−
9
View file @
26a4386b
...
...
@@ -173,17 +173,20 @@ def top10():
'
n_hits
'
:
'
Number of hits
'
,
'
overlays
'
:
'
Number of overlays
'
}
plo
ts
=
{}
even
ts
=
{}
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
)
raw_data
=
dbs
.
query
(
"
SELECT plot_filename, {cat} FROM event_selection
"
"
ORDER BY {cat} DESC LIMIT 10
"
.
format
(
cat
=
category
))
if
len
(
raw_data
)
>
0
:
events
[
category_names
[
category
]]
=
{
"
plot_filename
"
:
raw_data
[
0
],
"
meta
"
:
{
category
:
raw_data
[
1
]
},
}
return
render_template
(
'
top10.html
'
,
events
=
events
)
@app.route
(
'
/logs.html
'
)
...
...
This diff is collapsed.
Click to expand it.
app/templates/top10.html
+
5
−
5
View file @
26a4386b
...
...
@@ -2,19 +2,19 @@
{% block main %}
{% for category,
plot_filename
s in plots.items() %}
{% for category,
event
s in plots.items() %}
<h3
style=
"text-align: center"
>
{{ category }}
</h3>
<div
class=
"container-fluid"
>
{% for
plot_filename in plot_filename
s %}
{% for
event in event
s %}
<div
class=
"row"
>
<div
class=
"col-md-2"
style=
"vertical-align: middle"
>
<h3>
#{{ loop.index }}
</h3>
</div>
<div
class=
"col-md-8"
>
<a
href=
"{{ plot_filename }}"
>
<a
href=
"{{
event.
plot_filename }}"
>
<img
class=
"plot img-responsive"
style=
"padding: 20px"
src=
"{{ plot_filename }}"
alt=
"{{ plot_filename }}"
/>
src=
"{{
event.
plot_filename }}"
alt=
"{{
event.
plot_filename }}"
/>
</a>
</div>
<div
class=
"col-md-2"
>
...
...
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