Files
scylladb/test/perf/perf_fast_forward_report.py
Avi Kivity fcb8d040e8 treewide: use Software Package Data Exchange (SPDX) license identifiers
Instead of lengthy blurbs, switch to single-line, machine-readable
standardized (https://spdx.dev) license identifiers. The Linux kernel
switched long ago, so there is strong precedent.

Three cases are handled: AGPL-only, Apache-only, and dual licensed.
For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0),
reasoning that our changes are extensive enough to apply our license.

The changes we applied mechanically with a script, except to
licenses/README.md.

Closes #9937
2022-01-18 12:15:18 +01:00

57 lines
1.7 KiB
Python
Executable File

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019-present ScyllaDB
#
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
import argparse
import json
import matplotlib.pyplot as plt
cmdline_parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
cmdline_parser.add_argument('results', nargs=1, help='JSON file with full perf_fast_forward results')
cmdline_parser.add_argument('-o', '--output', help='name of the output file')
cmdline_parser.add_argument('--histogram', action='store_true', help='plot a histogram of the frag/s results')
cmdline_parser.add_argument('--histogram-bins-count', default=50, help='number of histogram bins')
cmdline_parser.add_argument('--histogram-stats', default='frag/s', help='comma-separated list of result statistic to prepare histograms of')
args = cmdline_parser.parse_args()
results = json.loads(open(args.results[0]).read())
if args.histogram:
histogram_stats = args.histogram_stats.split(',')
stats = results['results']['stats']
dpi = 96
width = 1200
height = 400 * len(histogram_stats)
plt.figure(figsize=(width/dpi, height/dpi), dpi=dpi)
count = 0
for histogram_stat in histogram_stats:
values = [stat[histogram_stat] for stat in stats]
count = count + 1
ax = plt.subplot(len(histogram_stats), 1, count)
if count == 1:
plt.title(args.results[0])
ax.set_axisbelow(True)
plt.grid(True)
plt.ylabel('count')
plt.xlabel(histogram_stat)
plt.hist(values, int(args.histogram_bins_count))
if args.output:
plt.savefig(args.output)
else:
plt.show()
else:
print('No action chosen. Doing nothing.')