4
5
6
7
8
9
10
11
12
|
# File 'lib/httperf-output-parser.rb', line 4
def parse(raw_httperf_output)
matches = raw_httperf_output.match(/connections (\d+).+duration ([\d.]+).+Connection rate: ([\d.]+).+Connection time \[ms\]: min ([\d.]+) avg ([\d.]+) max ([\d.]+) median ([\d.]+) stddev ([\d.]+).+Request rate: ([\d.]+) req\/s \(([\d.]+).+Reply rate.+min ([\d.]+) avg ([\d.]+) max ([\d.]+) stddev ([\d.]+).+Reply time.+response ([\d.]+)/m)
parsed_values = {}
15.times do |i|
parsed_values[data_types[i].to_sym] = matches[i+1].to_f
end
return parsed_values
end
|