gridinit-jmeter 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rbenv-version +1 -1
- data/bin/grid +0 -0
- data/lib/gridinit-jmeter.rb +1 -0
- data/lib/gridinit-jmeter/controllers/throughput.rb +26 -0
- data/lib/gridinit-jmeter/controllers/transaction.rb +1 -0
- data/lib/gridinit-jmeter/dsl.rb +8 -0
- data/lib/gridinit-jmeter/post_processors/regex_extractor.rb +1 -0
- data/lib/gridinit-jmeter/samplers/http_sampler.rb +8 -3
- data/lib/gridinit-jmeter/version.rb +1 -1
- metadata +3 -3
data/.rbenv-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.3-
|
1
|
+
1.9.3-p385
|
data/bin/grid
CHANGED
File without changes
|
data/lib/gridinit-jmeter.rb
CHANGED
@@ -100,6 +100,7 @@ require 'gridinit-jmeter/helpers/user-agents'
|
|
100
100
|
require 'gridinit-jmeter/controllers/once_only'
|
101
101
|
require 'gridinit-jmeter/controllers/if_controller'
|
102
102
|
require 'gridinit-jmeter/controllers/loop_controller'
|
103
|
+
require 'gridinit-jmeter/controllers/throughput'
|
103
104
|
|
104
105
|
# SAMPLERS
|
105
106
|
require 'gridinit-jmeter/samplers/http_sampler'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Gridinit
|
2
|
+
module Jmeter
|
3
|
+
|
4
|
+
class Throughput
|
5
|
+
attr_accessor :doc
|
6
|
+
include Helper
|
7
|
+
def initialize(name, percent, params={})
|
8
|
+
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
9
|
+
<ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="#{percent.to_i}%_#{name}" enabled="true">
|
10
|
+
<intProp name="ThroughputController.style">1</intProp>
|
11
|
+
<boolProp name="ThroughputController.perThread">false</boolProp>
|
12
|
+
<intProp name="ThroughputController.maxThroughput">1</intProp>
|
13
|
+
<FloatProperty>
|
14
|
+
<name>ThroughputController.percentThroughput</name>
|
15
|
+
<value>#{percent.to_f}</value>
|
16
|
+
<savedValue>0.0</savedValue>
|
17
|
+
</FloatProperty>
|
18
|
+
</ThroughputController>
|
19
|
+
EOF
|
20
|
+
update params
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
@@ -8,6 +8,7 @@ module Gridinit
|
|
8
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
9
9
|
<TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="#{name}" enabled="true">
|
10
10
|
<boolProp name="TransactionController.parent">true</boolProp>
|
11
|
+
<boolProp name="TransactionController.includeTimers">false</boolProp>
|
11
12
|
</TransactionController>
|
12
13
|
EOF
|
13
14
|
update params
|
data/lib/gridinit-jmeter/dsl.rb
CHANGED
@@ -113,6 +113,12 @@ module Gridinit
|
|
113
113
|
self.instance_exec(&block) if block
|
114
114
|
end
|
115
115
|
|
116
|
+
def throughput(name="throughput", percent=100.0, params={}, &block)
|
117
|
+
node = Gridinit::Jmeter::Throughput.new(name, percent, params)
|
118
|
+
attach_to_last(node, caller)
|
119
|
+
self.instance_exec(&block) if block
|
120
|
+
end
|
121
|
+
|
116
122
|
def If(name="If Controller", params={}, &block)
|
117
123
|
node = Gridinit::Jmeter::IfController.new(name, params)
|
118
124
|
attach_to_last(node, caller)
|
@@ -323,6 +329,8 @@ module Gridinit
|
|
323
329
|
'//ThreadGroup/following-sibling::hashTree'
|
324
330
|
when 'transaction'
|
325
331
|
'//TransactionController/following-sibling::hashTree'
|
332
|
+
when 'throughput'
|
333
|
+
'//ThroughputController/following-sibling::hashTree'
|
326
334
|
when 'once'
|
327
335
|
'//OnceOnlyController/following-sibling::hashTree'
|
328
336
|
when 'exists'
|
@@ -13,6 +13,7 @@ module Gridinit
|
|
13
13
|
<stringProp name="RegexExtractor.template">$1$</stringProp>
|
14
14
|
<stringProp name="RegexExtractor.default"></stringProp>
|
15
15
|
<stringProp name="RegexExtractor.match_number">0</stringProp>
|
16
|
+
<stringProp name="Sample.scope">all</stringProp>
|
16
17
|
</RegexExtractor>
|
17
18
|
EOF
|
18
19
|
update params
|
@@ -32,10 +32,15 @@ module Gridinit
|
|
32
32
|
parse_url(url, params) unless url.empty?
|
33
33
|
fill_in(params) if params[:fill_in]
|
34
34
|
raw_body(params) if params[:raw_body]
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
if params[:raw_path]
|
36
|
+
params[:path] = url
|
37
|
+
else
|
38
|
+
params[:params] && params[:params].split('&').each do |param|
|
39
|
+
name,value = param.split('=')
|
40
|
+
fill_in({ :fill_in => { "#{name}" => value }, :always_encode => params[:always_encode] })
|
41
|
+
end
|
38
42
|
end
|
43
|
+
|
39
44
|
update params
|
40
45
|
end
|
41
46
|
|
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: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
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-
|
12
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/gridinit-jmeter/controllers/if_controller.rb
|
97
97
|
- lib/gridinit-jmeter/controllers/loop_controller.rb
|
98
98
|
- lib/gridinit-jmeter/controllers/once_only.rb
|
99
|
+
- lib/gridinit-jmeter/controllers/throughput.rb
|
99
100
|
- lib/gridinit-jmeter/controllers/transaction.rb
|
100
101
|
- lib/gridinit-jmeter/dsl.rb
|
101
102
|
- lib/gridinit-jmeter/helpers/dsl_helper.rb
|
@@ -155,4 +156,3 @@ test_files:
|
|
155
156
|
- spec/dsl_spec.rb
|
156
157
|
- spec/spec_helper.rb
|
157
158
|
- spec/stub.rb
|
158
|
-
has_rdoc:
|