Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /benchmarks/parse_reports.py
ViewVC logotype

View of /benchmarks/parse_reports.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5650 - (download) (as text) (annotate)
Fri Oct 15 15:49:26 2021 UTC (6 weeks ago) by adrianlehmann
File size: 903 byte(s)
Add python script to parse JSON and create latex tables of result mean and std dev
#!/usr/bin/env python3
import json
import numpy
import sys

def usage():
  return 'Usage: parse_reports.py {Report file}'

def main():
    args = sys.argv[1:]
    if len(args) != 1:
      print(usage())
      return
    report_file_name = args[0]
    if '-report.' not in report_file_name:
      print('Error file incorrect: Should be named {benchmark}-report.{date}')
      print(usage())
      return
    with open(report_file_name) as json_file:
      benchmark_report_json = json.load(json_file)
      results = benchmark_report_json['results']
      print('Benchmark name & mean time & stddev time\\\\')
      for individual_benchmark in results:
        name = individual_benchmark['name']
        times = individual_benchmark['times']
        mean = numpy.mean(times)
        stddev = numpy.std(times)
        print(f'{name:s} & {mean:f} & {stddev:f}\\\\')

if __name__ == '__main__':
    main()

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0