-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.py
63 lines (55 loc) · 1.32 KB
/
stats.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import argparse
import json
import warnings
from file_size.file_size import SizeStatComputer
from log_time.log_time import TimeStatComputer
from utils import plot_all_stats
def main():
parser = argparse.ArgumentParser(
description='Script for size and time statistics.\
For more info see https://github.com/loooj58/BMAN'
)
parser.add_argument(
'--dir', '-d',
nargs=1,
type=str,
help='Name of directory to explore',
required=True
)
parser.add_argument(
'--size', '-s',
action='store_true',
help='Compute size statistics'
)
parser.add_argument(
'--time', '-t',
action='store_true',
help='Compute time statistics'
)
parser.add_argument(
'--recursive', '-r',
action='store_true',
help='Recursive data search'
)
parser.add_argument(
'--config', '-c',
nargs=1,
type=str,
help='Path to config file, default is ./config.txt',
required=True
)
parser.add_argument(
'--output', '-o',
nargs='?',
type=str,
help='Path to output file, default is ./output.png',
default='./output.png'
)
args = parser.parse_args()
_dir, size, time, config, output, recursive = \
args.dir[0], args.size, args.time,\
args.config[0], args.output, args.recursive
config_dict = json.load(open(config, 'r'))
plot_all_stats(size, time, config_dict, _dir, output, recursive)
if __name__ == '__main__':
main()