MCPcopy Create free account
hub / github.com/dbt-labs/ade-bench / generate_all_charts

Function generate_all_charts

scripts_python/profiling_statistics.py:578–602  ·  view source on GitHub ↗
(db_path: str)

Source from the content-addressed store, hash-verified

576
577
578def generate_all_charts(db_path: str):
579 conn = sqlite3.connect(db_path)
580 output_dir = Path(db_path).parent
581
582 cursor = conn.cursor()
583 cursor.execute("""
584 SELECT COUNT(DISTINCT f.id)
585 FROM functions f
586 JOIN function_stats fs ON f.id = fs.function_id
587 WHERE f.is_builtin = 0
588 AND f.filename IS NOT NULL
589 AND f.filename != '~'
590 AND f.filename NOT LIKE '%site-packages%'
591 AND f.filename NOT LIKE '%/lib/%'
592 AND f.filename NOT LIKE '%/lib64/%'
593 """)
594 num_functions = cursor.fetchone()[0]
595
596 total_charts = 8 + num_functions
597
598 with tqdm(total=total_charts, desc="Generating charts") as pbar:
599 generate_base_charts(conn, output_dir, pbar)
600 generate_function_charts(conn, output_dir, pbar)
601
602 conn.close()
603
604
605def run_profiling_session(script_path: str, extra_args: list) -> bool:

Callers 1

run_profiling_and_importFunction · 0.85

Calls 2

generate_base_chartsFunction · 0.70
generate_function_chartsFunction · 0.70

Tested by

no test coverage detected