-
Notifications
You must be signed in to change notification settings - Fork 1
/
pkrukr.py
51 lines (42 loc) · 1.57 KB
/
pkrukr.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import json
import printutil as pt
from scipy import stats
def generate_kraken_plots():
names = ["base", "alloc", "mpk"]
df = pd.DataFrame()
for n in names:
fname = "data/kraken_" + n + ".json"
with open(fname, "r") as f:
data = pd.read_json(fname)
data.drop(labels=['v'], axis = 1, inplace = True)
df[n] = data.mean()
# Plot raw values
plt.figure()
df.plot.bar(figsize=(19,10))
ax = plt.subplot(111)
ax.legend(loc='upper center', bbox_to_anchor=(0.5,1.13), fancybox=True, shadow=True, ncol=5)
plt.savefig('graphs/kraken_raw_scores.pdf', bbox_inches='tight', dpi=1000)
# Normalize on base
norm_df = df.divide(df['base'], axis=0)
norm_df.plot.bar(figsize=(6,2), ylim=(0.6,1.2), width=0.85)
ax = plt.subplot(111)
# octane benchmark
bars = ax.patches
patterns =('..','///','-', '+', 'x','/','//','O','o','\\','\\\\')
hatches = [p for p in patterns for i in range(len(norm_df))]
for bar, hatch in zip(bars, hatches):
bar.set_hatch(hatch)
leg =ax.legend(loc='lower right',
fancybox=True, shadow=True,fontsize=12)
for patch in leg.get_patches():
patch.set_height(15)
patch.set_y(-6)
plt.axhline(y=1.0, color = 'black', linestyle = '--')
plt.savefig('graphs/kraken_overhead.pdf', bbox_inches='tight', dpi=1000)
pt.print_table("Kraken Overhead Normalized", norm_df)
if __name__ == "__main__":
# pkrukr executed as script
generate_kraken_plots()