From 2bb1b183b1f0845527626d9b2962dc64bf3251d7 Mon Sep 17 00:00:00 2001 From: Richard Hitier Date: Mon, 30 Oct 2023 11:24:30 +0100 Subject: [PATCH] Add time logging to csv generator --- web/run.py | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/web/run.py b/web/run.py index 9b5a345..42ec14c 100755 --- a/web/run.py +++ b/web/run.py @@ -903,6 +903,8 @@ def generate_csv_contents(target_slug, input_slug, started_at, stopped_at): def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): + now = datetime.datetime.now() + hp_logger.debug(f"Generating csv content with Speasy for {target_slug}/{input_slug} between {stopped_at} {stopped_at}") target_config = get_target_config(target_slug) plasma_params = {} for plasma_struct in target_config['models'][input_slug]: @@ -957,6 +959,10 @@ def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): cols_ordered = [_c for _c in cols_ordered if _c in final_df.columns] final_df = final_df[cols_ordered] final_df.index.name = 'time' + + then = datetime.datetime.now() + hp_logger.debug(f"Took {then-now} to generate") + return final_df.to_csv(date_format='%Y-%m-%dT%H:%M:%S+00:00', float_format="%.5f", header=True, sep=",") -- libgit2 0.21.2