Skip to content
Snippets Groups Projects
Commit 0aaca255 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Add meta data to top10 events

parent 26a4386b
No related branches found
No related tags found
No related merge requests found
......@@ -173,20 +173,20 @@ def top10():
'n_hits': 'Number of hits',
'overlays': 'Number of overlays'
}
events = {}
top10 = {}
dbs = LocalDBService(filename="data/monitoring.sqlite3")
for category in ["overlays", "n_hits"]:
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]] = {
top10[category_names[category]] = {
"plot_filename": raw_data[0],
"meta": {
category: raw_data[1]
},
}
return render_template('top10.html', events=events)
return render_template('top10.html', top10=top10)
@app.route('/logs.html')
......
......@@ -2,7 +2,7 @@
{% block main %}
{% for category, events in plots.items() %}
{% for category, events in top10.items() %}
<h3 style="text-align: center">{{ category }}</h3>
<div class="container-fluid">
{% for event in events %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment