File size: 948 Bytes
f91d9a0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python3
"""Generate Markdown, JSON, CSV, and plots from benchmark raw outputs."""

from __future__ import annotations

import argparse
import json
from pathlib import Path

from lsvbench.report import generate_report


def main() -> None:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--output", type=Path, action="append", required=True, help="Benchmark output directory. Can be repeated.")
    parser.add_argument("--compare", type=Path, action="append", default=[], help="Additional output directory to compare.")
    parser.add_argument("--report-dir", type=Path, help="Where to write report.md, metrics, and plots. Defaults to first --output.")
    args = parser.parse_args()

    output_dirs = [*args.output, *args.compare]
    result = generate_report(output_dirs, report_dir=args.report_dir)
    print(json.dumps(result, indent=2, sort_keys=True))


if __name__ == "__main__":
    main()