@@ -51,6 +51,17 @@ def parse_args():
51
51
"--output" , "-o" , required = False , default = "metadata.json" , help = "Output file"
52
52
)
53
53
parser .add_argument ("--hier" , "-x" , action = "store_true" , help = "Hierarchical JSON" )
54
+ parser .add_argument ("--logs" , help = "Path to logs" , default = None )
55
+ parser .add_argument (
56
+ "--reports" ,
57
+ help = "Path to reports" ,
58
+ default = None ,
59
+ )
60
+ parser .add_argument (
61
+ "--results" ,
62
+ help = "Path to results" ,
63
+ default = None ,
64
+ )
54
65
args = parser .parse_args ()
55
66
56
67
return args
@@ -190,13 +201,11 @@ def merge_jsons(root_path, output, files):
190
201
file .close ()
191
202
192
203
193
- def extract_metrics (cwd , platform , design , flow_variant , output , hier_json ):
204
+ def extract_metrics (
205
+ cwd , platform , design , flow_variant , output , hier_json , logPath , rptPath , resultPath
206
+ ):
194
207
baseRegEx = "^{}\n ^-*\n ^{}"
195
208
196
- logPath = os .path .join (cwd , "logs" , platform , design , flow_variant )
197
- rptPath = os .path .join (cwd , "reports" , platform , design , flow_variant )
198
- resultPath = os .path .join (cwd , "results" , platform , design , flow_variant )
199
-
200
209
metrics_dict = defaultdict (dict )
201
210
metrics_dict ["run__flow__generate_date" ] = now .strftime ("%Y-%m-%d %H:%M" )
202
211
metrics_dict ["run__flow__metrics_version" ] = "Metrics_2.1.2"
@@ -404,7 +413,20 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
404
413
continue
405
414
print (f"Extract Metrics for { plt } , { des } , { variant } " )
406
415
file = "/" .join (["reports" , plt , des , variant , "metrics.json" ])
407
- metrics , df = extract_metrics (cwd , plt , des , variant , file , args .hier )
416
+ logPath = os .path .join (cwd , "logs" , plt , des , variant )
417
+ rptPath = os .path .join (cwd , "reports" , plt , des , variant )
418
+ resultPath = os .path .join (cwd , "results" , plt , des , variant )
419
+ metrics , df = extract_metrics (
420
+ cwd ,
421
+ plt ,
422
+ des ,
423
+ variant ,
424
+ file ,
425
+ args .hier ,
426
+ logPath ,
427
+ rptPath ,
428
+ resultPath ,
429
+ )
408
430
all_d .append (metrics )
409
431
if all_df .shape [0 ] == 0 :
410
432
all_df = df
@@ -424,4 +446,7 @@ def extract_metrics(cwd, platform, design, flow_variant, output, hier_json):
424
446
args .flowVariant ,
425
447
args .output ,
426
448
args .hier ,
449
+ args .logs ,
450
+ args .reports ,
451
+ args .results ,
427
452
)
0 commit comments