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
Container Registry
Model registry
Operate
Environments
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
km3py
km3mon
Commits
77240223
Commit
77240223
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Define "is_recent" to be within the last 24h
parent
f99ce147
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/routes.py
+4
-2
4 additions, 2 deletions
app/routes.py
with
4 additions
and
2 deletions
app/routes.py
+
4
−
2
View file @
77240223
...
...
@@ -3,6 +3,7 @@ from glob import glob
from
os.path
import
basename
,
join
,
exists
,
splitext
,
getsize
from
functools
import
wraps
from
collections
import
OrderedDict
import
time
import
toml
from
flask
import
render_template
,
send_from_directory
,
request
,
Response
from
app
import
app
...
...
@@ -185,7 +186,8 @@ def top10():
if
len
(
raw_data
)
>
0
:
print
(
raw_data
)
top10
[
category_names
[
category
]]
=
[{
"
plot_filename
"
:
r
[
0
],
"
plot_filename
"
:
r
[
0
],
"
meta
"
:
{
"
Number of hits (triggered)
"
:
"
{} ({})
"
.
format
(
r
[
1
],
r
[
2
]),
"
Overlays
"
:
r
[
3
],
...
...
@@ -195,7 +197,7 @@ def top10():
"
Trigger counter
"
:
r
[
7
],
"
Date
"
:
datetime
.
utcfromtimestamp
(
r
[
8
]).
strftime
(
"
%c
"
)
},
"
is_recent
"
:
True
"
is_recent
"
:
(
time
.
time
()
-
r
[
8
])
<
60
*
60
*
24
}
for
r
in
raw_data
]
return
render_template
(
'
top10.html
'
,
top10
=
top10
)
...
...
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