Skip to content

Commit

Permalink
Add export_dir support for recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-tau committed Jun 18, 2024
1 parent a0d5e12 commit a5c0d13
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions drishti/handlers/handle_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import os
import time

import pandas as pd
from recorder_utils import RecorderReader
from recorder_utils.build_offset_intervals import build_offset_intervals

from drishti.includes.module import *


Expand Down Expand Up @@ -577,23 +579,32 @@ def process_helper(file_map, df_intervals, df_posix_records, fid=None):
display_thresholds(console)
display_footer(console, insights_start_time, insights_end_time)

if args.split_files:
filename = '{}.{}.html'.format(args.log_path, fid)
else:
filename = '{}.html'.format(args.log_path)
# if args.split_files:
# filename = '{}.{}.html'.format(args.log_path, fid)
# else:
# filename = '{}.html'.format(args.log_path)

export_html(console, filename)
# export_html(console, filename)

if args.split_files:
filename = '{}.{}.svg'.format(args.log_path, fid)
else:
filename = '{}.svg'.format(args.log_path)
# if args.split_files:
# filename = '{}.{}.svg'.format(args.log_path, fid)
# else:
# filename = '{}.svg'.format(args.log_path)

export_svg(console, filename)
# export_svg(console, filename)

if args.split_files:
filename = '{}.{}.summary.csv'.format(args.log_path, fid)
else:
filename = '{}-summary.csv'.format(args.log_path)
export_csv(filename)
# if args.split_files:
# filename = '{}.{}.summary.csv'.format(args.log_path, fid)
# else:
# filename = '{}-summary.csv'.format(args.log_path)
# export_csv(filename)

# Export to HTML, SVG, and CSV
input_filename = os.path.basename(os.path.dirname(args.log_path))
input_filename = f"{input_filename}.{fid}" if args.split_files else input_filename # Append fid if split_files is enabled

out_dir = args.export_dir if args.export_dir != "" else os.getcwd()

export_html(console, out_dir, input_filename)
export_svg(console, out_dir, input_filename)
export_csv(out_dir, input_filename, job['job']['jobid'])

0 comments on commit a5c0d13

Please sign in to comment.