Class: HttperfOutputParser

Inherits:
Object
  • Object
show all
Defined in:
lib/httperf-output-parser.rb,
lib/httperf-output-parser/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#parse(raw_httperf_output) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/httperf-output-parser.rb', line 4

def parse(raw_httperf_output)
	# http://rubular.com/r/EZ4xSydMlk
	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