@@ -35,24 +35,26 @@ def create_charts(test_results):
35
35
workload_results [result ['workload' ]] = []
36
36
workload_results [result ['workload' ]].append (result )
37
37
38
- for name , results in workload_results .items ():
39
- print 'Generating charts for' , name
38
+ for workload , results in workload_results .items ():
39
+ print 'Generating charts for' , workload
40
+ workload = workload .replace ('/' , '-' )
40
41
41
- create_chart ('Publish latency 99pct' ,
42
+ create_chart (workload , 'Publish latency 99pct' ,
42
43
y_label = 'Latency (ms)' ,
43
44
time_series = [(x ['driver' ], x ['publishLatency99pct' ]) for x in results ])
44
45
45
- create_chart ('Publish rate' ,
46
+ create_chart (workload , 'Publish rate' ,
46
47
y_label = 'Rate (msg/s)' ,
47
48
time_series = [(x ['driver' ], x ['publishRate' ]) for x in results ])
48
49
49
- create_quantile_chart ('Publish latency quantiles' ,
50
+ create_quantile_chart (workload , 'Publish latency quantiles' ,
50
51
y_label = 'Latency (ms)' ,
51
52
time_series = [(x ['driver' ], x ['aggregatedPublishLatencyQuantiles' ]) for x in results ])
52
53
53
54
54
- def create_chart (title , y_label , time_series ):
55
- chart = pygal .XY ()
55
+ def create_chart (workload , title , y_label , time_series ):
56
+ chart = pygal .XY (dots_size = .3 ,
57
+ legend_at_bottom = True ,)
56
58
chart .title = title
57
59
58
60
chart .human_readable = True
@@ -64,10 +66,10 @@ def create_chart(title, y_label, time_series):
64
66
chart .add (label , [(10 * x , y ) for x , y in enumerate (values )])
65
67
66
68
chart .range = (0 , max (chain (* [l for (x , l ) in time_series ])) * 1.20 )
67
- chart .render_to_file (title + ' .svg' )
69
+ chart .render_to_file ('%s - %s .svg' % ( workload , title ) )
68
70
69
71
70
- def create_quantile_chart (title , y_label , time_series ):
72
+ def create_quantile_chart (workload , title , y_label , time_series ):
71
73
import math
72
74
chart = pygal .XY ( # style=pygal.style.LightColorizedStyle,
73
75
# fill=True,
@@ -89,7 +91,7 @@ def create_quantile_chart(title, y_label, time_series):
89
91
xy_values = [(math .log10 (100 / (100 - x )), y ) for x , y in values if x <= 99.999 ]
90
92
chart .add (label , xy_values )
91
93
92
- chart .render_to_file ('%s.svg' % title )
94
+ chart .render_to_file ('%s - %s .svg' % ( workload , title ) )
93
95
94
96
95
97
if __name__ == '__main__' :
0 commit comments