From e8c8574a22491708b0dbd782caf677069e7ec899 Mon Sep 17 00:00:00 2001 From: catttam Date: Thu, 17 Oct 2024 17:35:33 +0200 Subject: [PATCH] Minor fixes --- logs_metric_parser.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/logs_metric_parser.py b/logs_metric_parser.py index b35cda0..0422b8e 100644 --- a/logs_metric_parser.py +++ b/logs_metric_parser.py @@ -27,7 +27,7 @@ args = parser.parse_args() -if not args.create: +if not args.create and not args.inference: with open(args.file_path, 'r') as rawfile: metrics = json.loads(rawfile.read()) try: @@ -83,19 +83,19 @@ def parse_inference_goaccess(status_code, write_type): """ def parse_inference_log(write_type): with open(f'{OUTPUT_PATH}/services_inference_metrics.csv', write_type, newline='') as sfile: - writer = csv.writer(cfile) - if write_type == "w": write.writerow(["service_name", "exec_type", "status_code", "owner_uid", "request_date", "request_time"]) + writer = csv.writer(sfile) + if write_type == "w": writer.writerow(["service_name", "exec_type", "status_code", "owner_uid", "request_date", "request_time"]) with open(args.file_path, 'r') as rawfile: for log in rawfile: pattern = re.compile( r'\[GIN-EXECUTIONS-LOGGER\]\s' # Literal text "[GIN-EXECUTIONS-LOGGER]" - r'(?P\d{4}/\d{2}/\d{2})\s-\s(?P