Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CPUnetLOG
CPUnetLOG
Commits
4abdca5e
Commit
4abdca5e
authored
Oct 08, 2015
by
Mario Hock
Browse files
cmdline options for sample and display intervals
parent
e67df4ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
__init__.py
View file @
4abdca5e
...
...
@@ -135,8 +135,8 @@ def main_loop():
"""
## TODO this should be configurable by command line options
sample_interval
=
0.1
display_interval
=
1.0
sample_interval
=
float
(
args
.
interval
)
display_interval
=
float
(
args
.
displayinterval
)
display_skip
=
max
(
display_interval
/
sample_interval
,
1
)
...
...
@@ -226,6 +226,11 @@ if __name__ == "__main__":
help
=
"Path where the log files are stored in. (See --logging.)"
)
parser
.
add_argument
(
"-e"
,
"--environment"
,
help
=
"JSON file that holds arbitrary environment context. (This can be seen as a structured comment field.)"
)
parser
.
add_argument
(
"-i"
,
"--interval"
,
default
=
"0.5"
,
help
=
"Time between two samples (in seconds). [Default = 0.5]"
)
parser
.
add_argument
(
"-d"
,
"--displayinterval"
,
default
=
"1"
,
help
=
"Time between two display updates (in seconds). [Default = 1]"
)
# NICs
parser
.
add_argument
(
"--nics"
,
nargs
=
'+'
,
...
...
logging.py
View file @
4abdca5e
...
...
@@ -273,8 +273,8 @@ class LoggingManager:
self
.
watch_experiment
=
watch_experiment
# auto-logging
self
.
INACTIVITY_THRESHOLD
=
30
self
.
HISTORY_SIZE
=
5
self
.
INACTIVITY_THRESHOLD
=
30
# seconds
self
.
HISTORY_SIZE
=
5
# samples
self
.
auto_logging
=
autologging
if
(
autologging
):
self
.
log_history
=
HistoryStore
(
self
.
HISTORY_SIZE
)
...
...
@@ -395,7 +395,7 @@ class LoggingManager:
## Branch: Inactive sample.
if
(
not
self
.
_is_activity_on_nics
(
measurement
)
):
self
.
inactivity_count
+=
1
self
.
inactivity_count
+=
measurement
.
timespan
## Inactivity phase too long: Stop logging.
if
(
self
.
inactivity_count
>=
self
.
INACTIVITY_THRESHOLD
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment