()
| 206 | |
| 207 | |
| 208 | def main(): |
| 209 | parser = argparse.ArgumentParser(description="Plot ds4-bench throughput CSV data as SVG.") |
| 210 | parser.add_argument("csv", type=Path, help="input CSV produced by ds4-bench") |
| 211 | parser.add_argument("-o", "--output", type=Path, help="output SVG path") |
| 212 | parser.add_argument("--title", help="graph title; defaults to a title derived from the CSV name") |
| 213 | parser.add_argument("--width", type=int, default=960, help="SVG width in pixels") |
| 214 | parser.add_argument("--height", type=int, default=540, help="SVG height in pixels") |
| 215 | args = parser.parse_args() |
| 216 | |
| 217 | output = args.output |
| 218 | if output is None: |
| 219 | output = args.csv.with_name(f"{args.csv.stem}_ts.svg") |
| 220 | |
| 221 | rows = read_points(args.csv) |
| 222 | title = args.title or derive_title(args.csv) |
| 223 | output.write_text(render_svg(rows, title, args.width, args.height), encoding="utf-8") |
| 224 | |
| 225 | |
| 226 | if __name__ == "__main__": |
no test coverage detected