hansel 0.2.14 → 0.2.15
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hansel/hansel.rb +6 -1
- data/lib/hansel/httperf/httperf.rb +17 -16
- data/lib/hansel/version.rb +1 -1
- metadata +3 -3
data/lib/hansel/hansel.rb
CHANGED
@@ -53,8 +53,13 @@ module HanselCore
|
|
53
53
|
#
|
54
54
|
def run
|
55
55
|
while @jobs.length > 0 do
|
56
|
+
# do a warm up run first with the highest connection rate
|
56
57
|
@current_job = @jobs.pop
|
57
|
-
|
58
|
+
@current_rate = @current_job.high_rate.to_i
|
59
|
+
httperf true
|
60
|
+
|
61
|
+
(@current_job.low_rate.to_i..@current_job.high_rate.to_i).
|
62
|
+
step(@current_job.rate_step.to_i) do |rate|
|
58
63
|
@current_rate = rate
|
59
64
|
httperf
|
60
65
|
end
|
@@ -17,24 +17,25 @@ module HanselCore
|
|
17
17
|
# Runs httperf with a given request rate. Parses the output and returns
|
18
18
|
# a hash with the results.
|
19
19
|
#
|
20
|
-
def httperf
|
20
|
+
def httperf warm_up = false
|
21
21
|
httperf_cmd = build_httperf_cmd
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
22
|
+
if warm_up
|
23
|
+
# Do a warm up run to setup any resources
|
24
|
+
status "\n#{httperf_cmd} (warm up run)"
|
25
|
+
IO.popen("#{httperf_cmd} 2>&1")
|
26
|
+
else
|
27
|
+
IO.popen("#{httperf_cmd} 2>&1") do |pipe|
|
28
|
+
status "\n#{httperf_cmd}"
|
29
|
+
@results << (httperf_result = HttperfResult.new({
|
30
|
+
:rate => @current_rate,
|
31
|
+
:server => @current_job.server,
|
32
|
+
:port => @current_job.port,
|
33
|
+
:uri => @current_job.uri,
|
34
|
+
:num_conns => @current_job.num_conns
|
35
|
+
}))
|
36
|
+
HttperfResultParser.new(pipe).parse(httperf_result)
|
37
|
+
end
|
36
38
|
end
|
37
39
|
end
|
38
|
-
|
39
40
|
end
|
40
41
|
end
|
data/lib/hansel/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hansel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 15
|
10
|
+
version: 0.2.15
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Paul Mylchreest
|