-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse_linux_free.py
More file actions
35 lines (26 loc) · 904 Bytes
/
Copy pathparse_linux_free.py
File metadata and controls
35 lines (26 loc) · 904 Bytes
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
27
28
29
30
31
32
33
import argparse
from pathlib import Path
from free_logging.FreeLogging import FreeLogging
def main():
parser = argparse.ArgumentParser(prog='Free Log Parsing',
description='Parse a free log file.', epilog='TBD')
parser.add_argument('filename')
parser.add_argument('-p', '--plot', action='store_true')
parser.add_argument('--plots-path')
args = parser.parse_args()
flog = FreeLogging()
flog.setFilename(args.filename)
flog.readInFreeLog()
flog.createSwapDf()
flog.createMemoryDf()
if (args.plots_path):
if (args.plots_path[-1] != "/"):
args.plots_path = args.plots_path + "/"
flog.setPlotsPath(args.plots_path)
if (args.plot or args.plots_path):
Path(flog.getPlotsPath()).mkdir(exist_ok=True)
flog.plotSwap()
flog.plotMemory()
flog.plotDf()
if __name__ == "__main__":
main()