1 # supply the benchmark dump file as an argumetn to this program
3 require 'google_response_chart'
11 inject(0) { |i, s| s += i }
15 colors = %w{F74343 444130 7DA478 E4AC3D}
18 results = ServerTestResults.open(ARGV[0])
20 response_chart = GoogleChart::LineChart.new('400x300', Time.now.strftime('%Y.%m.%d'), true)
21 results.servers.each do |server|
22 data = results.data(server, :size).sort
23 response_chart.data(server, data, colors.shift)
24 # data.delete_if { |d| d[0] > 100.kilobytes }
25 x = data.map { |d| d[0] }.max
26 y = data.map { |d| d[1] }.max
27 max_x = x if x > max_x
28 max_y = y if y > max_y
30 response_chart.axis(:y, :range => [0,max_y])
31 response_chart.axis(:y, :labels => ['req/s'], :positions => [50])
32 response_chart.axis(:x, :range => [0,max_x])
33 response_chart.axis(:x, :labels => ['bytes served'], :positions => [50])
34 puts response_chart.to_url