gridinit-jmeter 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ module Gridinit
|
|
7
7
|
def initialize(name, params={})
|
8
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
9
9
|
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="#{name}" enabled="true">
|
10
|
-
<stringProp name="IfController.condition"
|
10
|
+
<stringProp name="IfController.condition"></stringProp>
|
11
11
|
<boolProp name="IfController.evaluateAll">false</boolProp>
|
12
12
|
</IfController>
|
13
13
|
EOF
|
data/lib/gridinit-jmeter/dsl.rb
CHANGED
@@ -29,7 +29,7 @@ module Gridinit
|
|
29
29
|
EOF
|
30
30
|
node = Gridinit::Jmeter::TestPlan.new
|
31
31
|
@root.at_xpath("//jmeterTestPlan/hashTree") << node.doc.children << hash_tree
|
32
|
-
|
32
|
+
|
33
33
|
variables(
|
34
34
|
:name => 'testguid',
|
35
35
|
:value => '${__P(testguid,${__time(,)})}',
|
@@ -144,7 +144,7 @@ module Gridinit
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def visit(name="HTTP Request", url="", params={}, &block)
|
147
|
-
params[:method] = 'GET'
|
147
|
+
params[:method] = 'GET' if params[:method] == nil
|
148
148
|
node = Gridinit::Jmeter::HttpSampler.new(name, url, params)
|
149
149
|
attach_to_last(node, caller)
|
150
150
|
self.instance_exec(&block) if block
|
@@ -329,7 +329,7 @@ module Gridinit
|
|
329
329
|
if params[:region] == 'local'
|
330
330
|
logger.info "Starting test ..."
|
331
331
|
params[:started] = Time.now
|
332
|
-
run params
|
332
|
+
run params
|
333
333
|
params[:completed] = Time.now
|
334
334
|
logger.info "Completed test ..."
|
335
335
|
logger.debug "Uploading results ..." if params[:debug]
|
@@ -339,9 +339,9 @@ module Gridinit
|
|
339
339
|
file = Tempfile.new('jmeter')
|
340
340
|
file.write(doc.to_xml(:indent => 2))
|
341
341
|
file.rewind
|
342
|
-
response = RestClient.post "http://#{params[:endpoint] ? params[:endpoint] : 'gridinit.com'}/api?token=#{token}®ion=#{params[:region]}",
|
342
|
+
response = RestClient.post "http://#{params[:endpoint] ? params[:endpoint] : 'gridinit.com'}/api?token=#{token}®ion=#{params[:region]}",
|
343
343
|
{
|
344
|
-
:name => 'attachment',
|
344
|
+
:name => 'attachment',
|
345
345
|
:attachment => File.new("#{file.path}", 'rb'),
|
346
346
|
:results => (File.new("#{params[:jtl] ? params[:jtl] : 'jmeter.jtl'}", 'rb') if params[:region] == 'local'),
|
347
347
|
:multipart => true,
|
@@ -354,7 +354,7 @@ module Gridinit
|
|
354
354
|
logger.fatal "There was an error: #{e.message}"
|
355
355
|
end
|
356
356
|
end
|
357
|
-
|
357
|
+
|
358
358
|
private
|
359
359
|
|
360
360
|
def hash_tree
|
@@ -397,7 +397,7 @@ module Gridinit
|
|
397
397
|
'//GaussianRandomTimer/following-sibling::hashTree'
|
398
398
|
when 'throughput_shaper'
|
399
399
|
'//kg.apc.jmeter.timers.VariableThroughputTimer/following-sibling::hashTree'
|
400
|
-
else
|
400
|
+
else
|
401
401
|
'//TestPlan/following-sibling::hashTree'
|
402
402
|
end
|
403
403
|
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: 0.2.
|
4
|
+
version: 0.2.3
|
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-04-
|
12
|
+
date: 2013-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|