From a51331be4c64bd46e726907d6d51d0e7be5273cc Mon Sep 17 00:00:00 2001 From: Kamal Fariz Mahyuddin Date: Thu, 8 Oct 2009 15:11:29 +0800 Subject: [PATCH] Allow host to use IP address or hostnames with digits in them --- autoperf.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoperf.rb b/autoperf.rb index 2a2af71..e70eb7b 100644 --- a/autoperf.rb +++ b/autoperf.rb @@ -42,7 +42,7 @@ def parse_config(config_file) else new_value = '' end - conf[var_name] = new_value =~ /\d+/ ? new_value.to_i : new_value + conf[var_name] = new_value end end } @@ -85,7 +85,7 @@ def run report = Table(:column_names => ['rate', 'conn/s', 'req/s', 'replies/s avg', 'errors', 'net io (KB/s)']) - (@conf['low_rate']..@conf['high_rate']).step(@conf['rate_step']) do |rate| + (@conf['low_rate'].to_i..@conf['high_rate'].to_i).step(@conf['rate_step'].to_i) do |rate| results[rate] = benchmark(@conf.merge({'httperf_rate' => rate})) report << results[rate].merge({'rate' => rate})