Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ActEV
diva_evaluation_cli
Commits
d4ac5e1d
Commit
d4ac5e1d
authored
Nov 20, 2018
by
Alexandre Boyer
Browse files
new attempt to fix monitor
parent
500093a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
diva_evaluation_cli/bin/commands/actev_command.py
View file @
d4ac5e1d
...
...
@@ -86,7 +86,8 @@ class ActevCommand():
StatusFactory
.
generateStatus
(
self
,
'start'
,
args
.
__dict__
)
self
.
before_command
(
args
)
Monitor
(
self
.
entry_point
,
args
,
self
.
command
)
mon
=
Monitor
(
self
.
entry_point
,
args
,
self
.
command
)
mon
.
run_monitor
()
self
.
after_command
(
args
)
logging
.
info
(
"%s done"
%
self
.
command
)
...
...
diva_evaluation_cli/bin/private_src/implementation/resources_monitoring/monitor.py
View file @
d4ac5e1d
...
...
@@ -57,8 +57,6 @@ class Monitor():
log_file_path
=
os
.
path
.
dirname
(
__file__
)
self
.
log_file
=
os
.
path
.
join
(
log_file_path
,
'./resources_monitoring.json'
)
# Run the monitoring process
self
.
run_monitor
()
def
run_monitor
(
self
):
...
...
@@ -69,13 +67,18 @@ class Monitor():
"""
self
.
main_process_pid
=
os
.
getpid
()
self
.
main_function
(
**
self
.
args
.
__dict__
)
self
.
main_process
=
Process
(
target
=
self
.
main_function
,
kwargs
=
self
.
args
.
__dict__
)
self
.
main_process
.
start
()
self
.
monitor
=
Process
(
target
=
self
.
monitor_resources
)
self
.
monitor
.
start
()
while
self
.
main_process
.
exitcode
is
None
:
pass
if
self
.
main_process
.
exitcode
!=
0
:
raise
Exception
def
increment_log_file
(
self
,
log_dict
):
"""Increment the file pointed by the `log_file` attribute with a new dict
...
...
Write
Preview
Supports
Markdown
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