MCPcopy Create free account
hub / github.com/antirez/ds4 / main

Function main

speed-bench/plot_speed.py:208–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206
207
208def 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
226if __name__ == "__main__":

Callers 1

plot_speed.pyFile · 0.70

Calls 3

read_pointsFunction · 0.85
derive_titleFunction · 0.85
render_svgFunction · 0.85

Tested by

no test coverage detected