Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,696
Issues
1,696
List
Boards
Labels
Service Desk
Milestones
Merge Requests
88
Merge Requests
88
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
98a85f1d
Commit
98a85f1d
authored
Feb 22, 2015
by
Mathieu Giraud
Committed by
Vidjil Team
Feb 22, 2015
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
controllers/admin.py, views/admin/*: add 'last_results' stats
parent
edbf8c53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
server/web2py/applications/vidjil/controllers/admin.py
server/web2py/applications/vidjil/controllers/admin.py
+10
-1
server/web2py/applications/vidjil/views/admin/monitor.html
server/web2py/applications/vidjil/views/admin/monitor.html
+1
-0
No files found.
server/web2py/applications/vidjil/controllers/admin.py
View file @
98a85f1d
...
...
@@ -2,6 +2,7 @@
import
gluon.contrib.simplejson
,
re
import
os.path
,
subprocess
import
vidjil_utils
from
collections
import
defaultdict
if
request
.
env
.
http_origin
:
response
.
headers
[
'Access-Control-Allow-Origin'
]
=
request
.
env
.
http_origin
...
...
@@ -28,10 +29,18 @@ def index():
def
monitor
():
# External monitor
last_results
=
''
for
res
in
db
(
db
.
scheduler_task
.
id
==
db
.
results_file
.
scheduler_task_id
).
select
(
orderby
=~
db
.
results_file
.
id
,
limitby
=
(
0
,
10
)):
last_results
+=
res
.
scheduler_task
.
status
[
0
]
return
dict
(
worker
=
len
(
db
().
select
(
db
.
scheduler_worker
.
ALL
)),
queued
=
len
(
db
(
db
.
scheduler_task
.
status
==
'QUEUED'
).
select
()),
assigned
=
len
(
db
(
db
.
scheduler_task
.
status
==
'ASSIGNED'
).
select
()),
running
=
len
(
db
(
db
.
scheduler_task
.
status
==
'RUNNING'
).
select
()))
running
=
len
(
db
(
db
.
scheduler_task
.
status
==
'RUNNING'
).
select
()),
last_results
=
last_results
)
def
worker
():
if
auth
.
has_membership
(
"admin"
):
...
...
server/web2py/applications/vidjil/views/admin/monitor.html
View file @
98a85f1d
...
...
@@ -4,4 +4,5 @@ tasks
QUEUED={{=queued}}
ASSIGNED={{=assigned}}
RUNNING={{=running}}
LAST_RESULTS={{=last_results}}...
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