Commit 4abdca5e authored by Mario Hock's avatar Mario Hock
Browse files

cmdline options for sample and display intervals

parent e67df4ab
...@@ -135,8 +135,8 @@ def main_loop(): ...@@ -135,8 +135,8 @@ def main_loop():
""" """
## TODO this should be configurable by command line options ## TODO this should be configurable by command line options
sample_interval = 0.1 sample_interval = float(args.interval)
display_interval = 1.0 display_interval = float(args.displayinterval)
display_skip = max(display_interval / sample_interval, 1) display_skip = max(display_interval / sample_interval, 1)
...@@ -226,6 +226,11 @@ if __name__ == "__main__": ...@@ -226,6 +226,11 @@ if __name__ == "__main__":
help="Path where the log files are stored in. (See --logging.)") help="Path where the log files are stored in. (See --logging.)")
parser.add_argument("-e", "--environment", parser.add_argument("-e", "--environment",
help="JSON file that holds arbitrary environment context. (This can be seen as a structured comment field.)") 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 # NICs
parser.add_argument("--nics", nargs='+', parser.add_argument("--nics", nargs='+',
......
...@@ -273,8 +273,8 @@ class LoggingManager: ...@@ -273,8 +273,8 @@ class LoggingManager:
self.watch_experiment = watch_experiment self.watch_experiment = watch_experiment
# auto-logging # auto-logging
self.INACTIVITY_THRESHOLD = 30 self.INACTIVITY_THRESHOLD = 30 # seconds
self.HISTORY_SIZE = 5 self.HISTORY_SIZE = 5 # samples
self.auto_logging = autologging self.auto_logging = autologging
if ( autologging ): if ( autologging ):
self.log_history = HistoryStore(self.HISTORY_SIZE) self.log_history = HistoryStore(self.HISTORY_SIZE)
...@@ -395,7 +395,7 @@ class LoggingManager: ...@@ -395,7 +395,7 @@ class LoggingManager:
## Branch: Inactive sample. ## Branch: Inactive sample.
if ( not self._is_activity_on_nics(measurement) ): if ( not self._is_activity_on_nics(measurement) ):
self.inactivity_count += 1 self.inactivity_count += measurement.timespan
## Inactivity phase too long: Stop logging. ## Inactivity phase too long: Stop logging.
if ( self.inactivity_count >= self.INACTIVITY_THRESHOLD ): if ( self.inactivity_count >= self.INACTIVITY_THRESHOLD ):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment