Commit 2bb1b183b1f0845527626d9b2962dc64bf3251d7
1 parent
8e79f472
Exists in
rhitier-dev
Add time logging to csv generator
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
web/run.py
@@ -903,6 +903,8 @@ def generate_csv_contents(target_slug, input_slug, started_at, stopped_at): | @@ -903,6 +903,8 @@ def generate_csv_contents(target_slug, input_slug, started_at, stopped_at): | ||
903 | 903 | ||
904 | 904 | ||
905 | def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): | 905 | def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): |
906 | + now = datetime.datetime.now() | ||
907 | + hp_logger.debug(f"Generating csv content with Speasy for {target_slug}/{input_slug} between {stopped_at} {stopped_at}") | ||
906 | target_config = get_target_config(target_slug) | 908 | target_config = get_target_config(target_slug) |
907 | plasma_params = {} | 909 | plasma_params = {} |
908 | for plasma_struct in target_config['models'][input_slug]: | 910 | 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): | @@ -957,6 +959,10 @@ def generate_csv_contents_spz(target_slug, input_slug, started_at, stopped_at): | ||
957 | cols_ordered = [_c for _c in cols_ordered if _c in final_df.columns] | 959 | cols_ordered = [_c for _c in cols_ordered if _c in final_df.columns] |
958 | final_df = final_df[cols_ordered] | 960 | final_df = final_df[cols_ordered] |
959 | final_df.index.name = 'time' | 961 | final_df.index.name = 'time' |
962 | + | ||
963 | + then = datetime.datetime.now() | ||
964 | + hp_logger.debug(f"Took {then-now} to generate") | ||
965 | + | ||
960 | return final_df.to_csv(date_format='%Y-%m-%dT%H:%M:%S+00:00', float_format="%.5f", | 966 | return final_df.to_csv(date_format='%Y-%m-%dT%H:%M:%S+00:00', float_format="%.5f", |
961 | header=True, | 967 | header=True, |
962 | sep=",") | 968 | sep=",") |