gridinit-jmeter 1.0.0.pre → 1.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/basic_throughput_controller.rb +14 -0
- data/lib/gridinit-jmeter/dsl.rb +6 -5
- data/lib/gridinit-jmeter/version.rb +1 -1
- data/spec/dsl_spec.rb +24 -1
- metadata +3 -2
@@ -0,0 +1,14 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
require 'gridinit-jmeter'
|
3
|
+
|
4
|
+
test do
|
5
|
+
threads count: 100 do
|
6
|
+
|
7
|
+
think_time 5000,5000
|
8
|
+
|
9
|
+
throughput_controller percent: 100 do
|
10
|
+
transaction name: "TC_01", parent: true, include_timers: true
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end.run(path: '/usr/share/jmeter/bin/', gui: true)
|
data/lib/gridinit-jmeter/dsl.rb
CHANGED
@@ -179,6 +179,12 @@ module Gridinit
|
|
179
179
|
|
180
180
|
alias_method :Loop, :loop_controller
|
181
181
|
|
182
|
+
def throughput_controller(params, &block)
|
183
|
+
params[:style] = 1 if params[:percent]
|
184
|
+
params[:maxThroughput] = params[:total] || params[:percent] || 1
|
185
|
+
super
|
186
|
+
end
|
187
|
+
|
182
188
|
alias_method :Throughput, :throughput_controller
|
183
189
|
|
184
190
|
alias_method :Switch, :switch_controller
|
@@ -205,11 +211,6 @@ module Gridinit
|
|
205
211
|
##
|
206
212
|
# Other Elements
|
207
213
|
|
208
|
-
def beanshell_preprocessor(params, &block)
|
209
|
-
params[:script] = "<![CDATA[#{params[:script]}]]>"
|
210
|
-
super
|
211
|
-
end
|
212
|
-
|
213
214
|
alias_method :bsh_pre, :beanshell_preprocessor
|
214
215
|
|
215
216
|
def extract(params, &block)
|
data/spec/dsl_spec.rb
CHANGED
@@ -125,6 +125,30 @@ describe "DSL" do
|
|
125
125
|
end
|
126
126
|
|
127
127
|
|
128
|
+
describe 'throughput controller' do
|
129
|
+
let(:doc) do
|
130
|
+
test do
|
131
|
+
threads do
|
132
|
+
throughput_controller percent: 100 do
|
133
|
+
transaction name: "TC_01", parent: true, include_timers: true
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end.to_doc
|
137
|
+
end
|
138
|
+
|
139
|
+
let(:fragment) { doc.search("//ThroughputController").first }
|
140
|
+
|
141
|
+
it 'should match on maxThroughput' do
|
142
|
+
# puts doc.to_xml indent: 2
|
143
|
+
fragment.search(".//intProp[@name='ThroughputController.maxThroughput']").text.should == '100'
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'should match on style' do
|
147
|
+
fragment.search(".//intProp[@name='ThroughputController.style']").text.should == '1'
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
|
128
152
|
describe 'visit' do
|
129
153
|
let(:doc) do
|
130
154
|
test do
|
@@ -405,7 +429,6 @@ describe "DSL" do
|
|
405
429
|
let(:fragment) { doc.search("//ResponseAssertion").first }
|
406
430
|
|
407
431
|
it 'should match on scope' do
|
408
|
-
puts doc.to_xml indent: 2
|
409
432
|
fragment.search(".//stringProp[@name='Assertion.scope']").text.should == ""
|
410
433
|
end
|
411
434
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gridinit-jmeter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1.pre
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- examples/basic_post.rb
|
74
74
|
- examples/basic_query_params.rb
|
75
75
|
- examples/basic_think_time.rb
|
76
|
+
- examples/basic_throughput_controller.rb
|
76
77
|
- examples/basic_throughput_shaping_timer.rb
|
77
78
|
- examples/etsy_login_browse.rb
|
78
79
|
- gridinit-jmeter.gemspec
|