def plot_results(self): def open_plot_in_browser(): time.sleep(1) webbrowser.open_new_tab('http://127.0.0.1:8050/') threading.Thread(target=open_plot_in_browser).start() run_dash_server(self.get_results())
duration, candidateLuaScript) results[candidateName] = candidateRes return {"benchmark": benchName, "results": results} def bench(args): benchSpecs = yaml.load(args.spec) bench = args.bench if bench: benchSpecs = list(filter(lambda bs: bs['name'] == bench, benchSpecs)) if not benchSpecs: print("no such benchmark exists in the spec: {}".format(query)) sys.exit(1) results = [] for benchSpec in benchSpecs: results.append(benchQuery(benchSpec)) return results if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--spec', nargs='?', type=argparse.FileType('r'), default=sys.stdin) parser.add_argument('--bench', nargs='?', type=str) args = parser.parse_args() results = bench(args) run_dash_server(results)