Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.cmdline
Commits
8baa8fbe
Commit
8baa8fbe
authored
Jul 13, 2018
by
Flavio TARSETTI
Browse files
Merge branch 'cpu_stats_fix' into '1.4.x'
Handle case where CPU stats return 0 See merge request
!42
parents
d895b03d
464421de
Pipeline
#21844
passed with stages
in 39 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/experiments.py
View file @
8baa8fbe
...
...
@@ -229,13 +229,18 @@ def run_experiment(configuration, name, force, use_docker, use_local):
cpu_stats
=
stats
[
'cpu'
]
data_stats
=
stats
[
'data'
]
cpu_total
=
cpu_stats
[
'total'
]
# Likely means that GPU was used
if
not
cpu_total
:
cpu_total
=
1.0
logger
.
extra
(
" CPU time (user, system, total, percent): "
"%s, %s, %s, %d%%"
,
simplify_time
(
cpu_stats
[
'user'
]),
simplify_time
(
cpu_stats
[
'system'
]),
simplify_time
(
cpu_
stats
[
'
total
'
]
),
simplify_time
(
cpu_total
),
100.
*
(
cpu_stats
[
'user'
]
+
cpu_stats
[
'system'
])
/
cpu_
stats
[
'
total
'
]
)
cpu_total
)
logger
.
extra
(
" Memory usage: %s"
,
simplify_size
(
stats
[
'memory'
][
'rss'
]))
logger
.
extra
(
" Cached input read: %s, %s"
,
...
...
@@ -247,7 +252,7 @@ def run_experiment(configuration, name, force, use_docker, use_local):
logger
.
extra
(
" Communication time: %s (%d%%)"
,
simplify_time
(
data_stats
[
'network'
][
'wait_time'
]),
100.
*
data_stats
[
'network'
][
'wait_time'
]
/
cpu_
stats
[
'
total
'
]
)
cpu_total
)
else
:
logger
.
extra
(
" Environment: %s"
%
'local environment'
)
...
...
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