-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.py
26 lines (21 loc) · 1.13 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import argparse
from tegrastats import Tegrastats
from parse import Parse
from graph import Graph
if __name__ == '__main__':
# Command line argument parser
parser = argparse.ArgumentParser()
parser.add_argument('--interval', '-i', type=int, default=1000, help='Logging interval in milliseconds for tegrastats')
parser.add_argument('--log_file', '-f', default='output_log.txt', help='Log file name for tegrastats data')
parser.add_argument('--verbose', '-v', action='store_true', help='Prints verbose messages while running tegrastats')
parser.add_argument('--only_parse', '-p', action='store_true', help='Parse tegrastats log file without running tegrastats')
parser.add_argument('--graph', '-g', action='store_true', help='Plots some useful graphs from tegrastats data parsed')
options = parser.parse_args()
tegrastats = Tegrastats(options.interval, options.log_file, options.verbose)
parser = Parse(options.interval, options.log_file)
if not options.only_parse:
status = tegrastats.run()
csv_file = parser.parse_file()
if options.graph:
graph = Graph(csv_file)
graph.plots()