Files
rippled/bench/plot_bench.py
Vinnie Falco 79159ffd87 Squashed 'src/nudb/' content from commit 00adc6a
git-subtree-dir: src/nudb
git-subtree-split: 00adc6a4f16679a376f40c967f77dfa544c179c1
2016-09-29 19:24:12 -04:00

38 lines
1015 B
Python

#/usr/bin/env python
# Script to read the result of the benchmark program and plot the results.
# Options:
# `-i arg` : input file (benchmark result)
# Notes: After the script runs the plot will automatically be shown in matplotlib.
# Tested with python 3 only.
import argparse
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def run_main(result_filename):
d = pd.read_csv(result_filename)
p = sns.lmplot(x='num_db_items', y='ops/sec', data=d[d['num_db_items']>=500000], hue='db', col='op')
plt.show(p)
return d # for testing
def parse_args():
parser = argparse.ArgumentParser(
description=('Plot the benchmark results'))
parser.add_argument(
'--input',
'-i',
help=('input'), )
return parser.parse_args()
if __name__ == '__main__':
args = parse_args()
result_filename = args.input
if not result_filename:
print('No result file specified. Exiting')
else:
run_main(result_filename)