Plot previously collected metrics, based on command line arguments.
()
| 126 | |
| 127 | |
| 128 | def plot_from_argv() -> None: |
| 129 | """ Plot previously collected metrics, based on command line arguments. """ |
| 130 | parser = argparse.ArgumentParser(description="Plot a benchmark suite.") |
| 131 | parser.add_argument( |
| 132 | "--no_subdir", |
| 133 | "--no-subdir", |
| 134 | action="store_true", |
| 135 | help="By default this script will create a subdirectory inside `dest` and write output to" |
| 136 | " that. Setting this flag will suppress the subdirectory and use `dest` directly.", |
| 137 | ) |
| 138 | parser.add_argument( |
| 139 | "suite", |
| 140 | type=str, |
| 141 | choices=BENCHMARK_SUITES.names(), |
| 142 | help="Which benchmark suite to run.", |
| 143 | ) |
| 144 | parser.add_argument( |
| 145 | "sources", |
| 146 | type=Path, |
| 147 | nargs="+", |
| 148 | help="Directory(s) to read data from." |
| 149 | " These will be recursively crawled to find all `metrics.csv`s.", |
| 150 | ) |
| 151 | parser.add_argument( |
| 152 | "dest", |
| 153 | type=Path, |
| 154 | help="Directory to write results to.", |
| 155 | ) |
| 156 | args = parser.parse_args() |
| 157 | |
| 158 | metadata = BenchmarkMetadata.create(args.suite) |
| 159 | suite = BENCHMARK_SUITES.get(args.suite) |
| 160 | results_df, results_metadata = _crawl_sources(args.sources) |
| 161 | dest = setup_dest(metadata, args.dest, args.no_subdir) |
| 162 | plot(metadata, suite, results_df, results_metadata, dest) |
| 163 | |
| 164 | |
| 165 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…