ruby-jmeter 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/dummy_sampler.rb +2 -1
- data/examples/stepping_thread_group.rb +2 -1
- data/examples/throughput_shaping_timer.rb +1 -1
- data/examples/ultimate_thread_group.rb +18 -17
- data/lib/ruby-jmeter/extend/plugins/jmeter_plugins.rb +24 -24
- data/lib/ruby-jmeter/plugins/active_threads_over_time.rb +3 -2
- data/lib/ruby-jmeter/plugins/composite_graph.rb +3 -2
- data/lib/ruby-jmeter/plugins/console_status_logger.rb +3 -2
- data/lib/ruby-jmeter/plugins/dummy_sampler.rb +6 -3
- data/lib/ruby-jmeter/plugins/latencies_over_time.rb +3 -2
- data/lib/ruby-jmeter/plugins/response_codes_per_second.rb +3 -2
- data/lib/ruby-jmeter/plugins/response_times_distribution.rb +3 -2
- data/lib/ruby-jmeter/plugins/response_times_over_time.rb +3 -2
- data/lib/ruby-jmeter/plugins/response_times_percentiles.rb +3 -2
- data/lib/ruby-jmeter/plugins/stepping_thread_group.rb +2 -2
- data/lib/ruby-jmeter/plugins/transactions_per_second.rb +3 -2
- data/lib/ruby-jmeter/plugins/ultimate_thread_group.rb +2 -1
- data/lib/ruby-jmeter/plugins/variable_throughput_timer.rb +4 -3
- data/lib/ruby-jmeter/version.rb +1 -1
- data/spec/jmeter_plugins_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bd3659e8b6c63f914431419f9eeacfa7e7df8d8
|
4
|
+
data.tar.gz: 1706ffed23bd94c9a6bfdb39c5895a8125fb385f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4cdbda09d55d140d39a938f02abec9565ed94a004017ff34756009de8cda1b681f86028d5b1e958f13d934b3533e5daa2837aa183e3bea4e7cdb3925caa20c7
|
7
|
+
data.tar.gz: 03a415a86d46d38dc238c6410b59982159d66b46ba0631376ceb73967f0d9213599048e16777c33a2a9d3c8f6438bd172d038c9905841d84f47c8c819c4ed863
|
data/examples/dummy_sampler.rb
CHANGED
@@ -3,6 +3,7 @@ require 'ruby-jmeter'
|
|
3
3
|
|
4
4
|
test do
|
5
5
|
threads count: 1 do
|
6
|
-
dummy_sampler '__grid_data_api',
|
6
|
+
dummy_sampler name: '__grid_data_api',
|
7
|
+
response_data: 'ACIR0001, ACIR0002, ACIR0003, ACIR0004, ACIR0005, ACIR0006, ABS0003, MBS0001, MBS0004, MBS0005, ABS0004, ABS0005, ABS0010, ABS0011, ABS0012, ABS0013, ABS0014, ABS0016, ABS0017, ABS0018, ABS0021, ABS0022, MBS0006, MBS0009, MBS0010'
|
7
8
|
end
|
8
9
|
end.run(path: '/usr/share/jmeter/bin/', gui: true)
|
@@ -12,7 +12,8 @@ test do
|
|
12
12
|
{ name: 'Accept', value: 'text/javascript, text/html, application/xml, text/xml, */*' }
|
13
13
|
]
|
14
14
|
|
15
|
-
step
|
15
|
+
step name: 'stepping thread group example',
|
16
|
+
total_threads: 200,
|
16
17
|
initial_delay: 0,
|
17
18
|
start_threads: 20,
|
18
19
|
add_threads: 0,
|
@@ -4,7 +4,7 @@ require 'ruby-jmeter'
|
|
4
4
|
test do
|
5
5
|
threads count: 100 do # threads = RPS * <max response time ms> / 1000
|
6
6
|
|
7
|
-
throughput_shaper 'increasing load test', [
|
7
|
+
throughput_shaper name: 'increasing load test', steps: [
|
8
8
|
{ :start_rps => 100, :end_rps => 100, :duration => 60 },
|
9
9
|
{ :start_rps => 200, :end_rps => 200, :duration => 60 },
|
10
10
|
{ :start_rps => 300, :end_rps => 300, :duration => 60 },
|
@@ -12,23 +12,24 @@ test do
|
|
12
12
|
{ name: 'Accept', value: 'text/javascript, text/html, application/xml, text/xml, */*' }
|
13
13
|
]
|
14
14
|
|
15
|
-
ultimate
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
15
|
+
ultimate name: 'ultimate thread group example',
|
16
|
+
on_sample_error: 'startnextloop',
|
17
|
+
threads: [
|
18
|
+
{
|
19
|
+
start_threads: 200,
|
20
|
+
initial_delay: 0,
|
21
|
+
start_time: 30,
|
22
|
+
hold_time: 60,
|
23
|
+
stop_time: 5
|
24
|
+
},
|
25
|
+
{
|
26
|
+
start_threads: 200,
|
27
|
+
initial_delay: 60,
|
28
|
+
start_time: 30,
|
29
|
+
hold_time: 60,
|
30
|
+
stop_time: 5
|
31
|
+
}
|
32
|
+
] do
|
32
33
|
|
33
34
|
random_timer 1000, 3000
|
34
35
|
|
@@ -1,51 +1,51 @@
|
|
1
1
|
module RubyJmeter
|
2
2
|
class ExtendedDSL < DSL
|
3
|
-
def response_codes_per_second(
|
4
|
-
node = RubyJmeter::Plugins::ResponseCodesPerSecond.new(
|
3
|
+
def response_codes_per_second(params = {}, &block)
|
4
|
+
node = RubyJmeter::Plugins::ResponseCodesPerSecond.new(params)
|
5
5
|
attach_node(node, &block)
|
6
6
|
end
|
7
7
|
|
8
|
-
def response_times_distribution(
|
9
|
-
node = RubyJmeter::Plugins::ResponseTimesDistribution.new(
|
8
|
+
def response_times_distribution(params = {}, &block)
|
9
|
+
node = RubyJmeter::Plugins::ResponseTimesDistribution.new(params)
|
10
10
|
attach_node(node, &block)
|
11
11
|
end
|
12
12
|
|
13
|
-
def response_times_over_time(
|
14
|
-
node = RubyJmeter::Plugins::ResponseTimesOverTime.new(
|
13
|
+
def response_times_over_time(params = {}, &block)
|
14
|
+
node = RubyJmeter::Plugins::ResponseTimesOverTime.new(params)
|
15
15
|
attach_node(node, &block)
|
16
16
|
end
|
17
17
|
|
18
|
-
def response_times_percentiles(
|
19
|
-
node = RubyJmeter::Plugins::ResponseTimesPercentiles.new(
|
18
|
+
def response_times_percentiles(params = {}, &block)
|
19
|
+
node = RubyJmeter::Plugins::ResponseTimesPercentiles.new(params)
|
20
20
|
attach_node(node, &block)
|
21
21
|
end
|
22
22
|
|
23
|
-
def transactions_per_second(
|
24
|
-
node = RubyJmeter::Plugins::TransactionsPerSecond.new(
|
23
|
+
def transactions_per_second(params = {}, &block)
|
24
|
+
node = RubyJmeter::Plugins::TransactionsPerSecond.new(params)
|
25
25
|
attach_node(node, &block)
|
26
26
|
end
|
27
27
|
|
28
|
-
def latencies_over_time(
|
29
|
-
node = RubyJmeter::Plugins::LatenciesOverTime.new(
|
28
|
+
def latencies_over_time(params = {}, &block)
|
29
|
+
node = RubyJmeter::Plugins::LatenciesOverTime.new(params)
|
30
30
|
attach_node(node, &block)
|
31
31
|
end
|
32
32
|
|
33
|
-
def console_status_logger(
|
34
|
-
node = RubyJmeter::Plugins::ConsoleStatusLogger.new(
|
33
|
+
def console_status_logger(params = {}, &block)
|
34
|
+
node = RubyJmeter::Plugins::ConsoleStatusLogger.new(params)
|
35
35
|
attach_node(node, &block)
|
36
36
|
end
|
37
37
|
|
38
38
|
alias console console_status_logger
|
39
39
|
|
40
|
-
def throughput_shaper(
|
41
|
-
node = RubyJmeter::Plugins::ThroughputShapingTimer.new(
|
40
|
+
def throughput_shaper(params = {}, &block)
|
41
|
+
node = RubyJmeter::Plugins::ThroughputShapingTimer.new(params)
|
42
42
|
attach_node(node, &block)
|
43
43
|
end
|
44
44
|
|
45
45
|
alias shaper throughput_shaper
|
46
46
|
|
47
|
-
def dummy_sampler(
|
48
|
-
node = RubyJmeter::Plugins::DummySampler.new(
|
47
|
+
def dummy_sampler(params = {}, &block)
|
48
|
+
node = RubyJmeter::Plugins::DummySampler.new(params)
|
49
49
|
attach_node(node, &block)
|
50
50
|
end
|
51
51
|
|
@@ -58,10 +58,10 @@ module RubyJmeter
|
|
58
58
|
|
59
59
|
alias step stepping_thread_group
|
60
60
|
|
61
|
-
def ultimate_thread_group(
|
61
|
+
def ultimate_thread_group(params = {}, &block)
|
62
62
|
node = RubyJmeter::Plugins::UltimateThreadGroup.new(params)
|
63
63
|
|
64
|
-
|
64
|
+
(params.kind_of?(Array) ? params : params[:threads]).each_with_index do |group, index|
|
65
65
|
node.doc.at_xpath('//collectionProp') <<
|
66
66
|
Nokogiri::XML(<<-EOS.strip_heredoc).children
|
67
67
|
<collectionProp name="index">
|
@@ -79,8 +79,8 @@ module RubyJmeter
|
|
79
79
|
|
80
80
|
alias ultimate ultimate_thread_group
|
81
81
|
|
82
|
-
def composite_graph(
|
83
|
-
node = RubyJmeter::Plugins::CompositeGraph.new(
|
82
|
+
def composite_graph(params = {}, &block)
|
83
|
+
node = RubyJmeter::Plugins::CompositeGraph.new(params)
|
84
84
|
attach_node(node, &block)
|
85
85
|
end
|
86
86
|
|
@@ -100,8 +100,8 @@ module RubyJmeter
|
|
100
100
|
|
101
101
|
alias perfmon perfmon_collector
|
102
102
|
|
103
|
-
def loadosophia_uploader(
|
104
|
-
node = RubyJmeter::Plugins::LoadosophiaUploader.new(
|
103
|
+
def loadosophia_uploader(params = {}, &block)
|
104
|
+
node = RubyJmeter::Plugins::LoadosophiaUploader.new(params)
|
105
105
|
attach_node(node, &block)
|
106
106
|
end
|
107
107
|
|
@@ -3,9 +3,10 @@ module RubyJmeter
|
|
3
3
|
class ActiveThreadsOverTime
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'ActiveThreadsOverTime' : (params[:name] || 'ActiveThreadsOverTime')
|
7
8
|
@doc = Nokogiri::XML(<<-XML.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ThreadsStateOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{
|
9
|
+
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ThreadsStateOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="true">
|
9
10
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
10
11
|
<objProp>
|
11
12
|
<name>saveConfig</name>
|
@@ -3,7 +3,8 @@ module RubyJmeter
|
|
3
3
|
class CompositeGraph
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'CompositeGraph' : (params[:name] || 'CompositeGraph')
|
7
8
|
graphNodes = params.collect { |g| "<stringProp name=\"\">#{g[:graph]}</stringProp>"}
|
8
9
|
metricNodes = params.collect { |m| "<stringProp name=\"\">#{m[:metric]}</stringProp>"}
|
9
10
|
|
@@ -19,7 +20,7 @@ module RubyJmeter
|
|
19
20
|
XML
|
20
21
|
|
21
22
|
@doc = Nokogiri::XML(<<-XML.strip_heredoc)
|
22
|
-
<kg.apc.jmeter.vizualizers.CompositeResultCollector guiclass="kg.apc.jmeter.vizualizers.CompositeGraphGui" testclass="kg.apc.jmeter.vizualizers.CompositeResultCollector" testname="#{
|
23
|
+
<kg.apc.jmeter.vizualizers.CompositeResultCollector guiclass="kg.apc.jmeter.vizualizers.CompositeGraphGui" testclass="kg.apc.jmeter.vizualizers.CompositeResultCollector" testname="#{testname}" enabled="true">
|
23
24
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
24
25
|
<objProp>
|
25
26
|
<name>saveConfig</name>
|
@@ -3,9 +3,10 @@ module RubyJmeter
|
|
3
3
|
class ConsoleStatusLogger
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'ConsoleStatusLogger' : (params[:name] || 'ConsoleStatusLogger')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.reporters.ConsoleStatusLogger guiclass="kg.apc.jmeter.reporters.ConsoleStatusLoggerGui" testclass="kg.apc.jmeter.reporters.ConsoleStatusLogger" testname="#{
|
9
|
+
<kg.apc.jmeter.reporters.ConsoleStatusLogger guiclass="kg.apc.jmeter.reporters.ConsoleStatusLoggerGui" testclass="kg.apc.jmeter.reporters.ConsoleStatusLogger" testname="#{testname}" enabled="true"/>
|
9
10
|
EOF
|
10
11
|
update params
|
11
12
|
end
|
@@ -3,9 +3,10 @@ module RubyJmeter
|
|
3
3
|
class DummySampler
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'DummySampler' : (params[:name] || 'DummySampler')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.samplers.DummySampler guiclass="kg.apc.jmeter.samplers.DummySamplerGui" testclass="kg.apc.jmeter.samplers.DummySampler" testname="#{
|
9
|
+
<kg.apc.jmeter.samplers.DummySampler guiclass="kg.apc.jmeter.samplers.DummySamplerGui" testclass="kg.apc.jmeter.samplers.DummySampler" testname="#{testname}" enabled="true">
|
9
10
|
<boolProp name="WAITING">true</boolProp>
|
10
11
|
<boolProp name="SUCCESFULL">true</boolProp>
|
11
12
|
<stringProp name="RESPONSE_CODE">200</stringProp>
|
@@ -16,7 +17,9 @@ module RubyJmeter
|
|
16
17
|
<stringProp name="LATENCY">0</stringProp>
|
17
18
|
</kg.apc.jmeter.samplers.DummySampler>
|
18
19
|
EOF
|
19
|
-
|
20
|
+
upcased_params = {}
|
21
|
+
params.each {|k,v| upcased_params[k.to_s.upcase] = v}
|
22
|
+
update upcased_params
|
20
23
|
end
|
21
24
|
end
|
22
25
|
end
|
@@ -3,9 +3,10 @@ module RubyJmeter
|
|
3
3
|
class LatenciesOverTime
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'LatenciesOverTime' : (params[:name] || 'LatenciesOverTime')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.LatenciesOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{
|
9
|
+
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.LatenciesOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
|
9
10
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
10
11
|
<objProp>
|
11
12
|
<name>saveConfig</name>
|
@@ -3,9 +3,10 @@ module RubyJmeter
|
|
3
3
|
class ResponseCodesPerSecond
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'ResponseCodesPerSecond' : (params[:name] || 'ResponseCodesPerSecond')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseCodesPerSecondGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{
|
9
|
+
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseCodesPerSecondGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
|
9
10
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
10
11
|
<objProp>
|
11
12
|
<name>saveConfig</name>
|
@@ -3,9 +3,10 @@ module RubyJmeter
|
|
3
3
|
class ResponseTimesDistribution
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'ResponseTimesDistribution' : (params[:name] || 'ResponseTimesDistribution')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesDistributionGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{
|
9
|
+
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesDistributionGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
|
9
10
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
10
11
|
<objProp>
|
11
12
|
<name>saveConfig</name>
|
@@ -3,9 +3,10 @@ module RubyJmeter
|
|
3
3
|
class ResponseTimesOverTime
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'ResponseTimesOverTime' : (params[:name] || 'ResponseTimesOverTime')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{
|
9
|
+
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesOverTimeGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
|
9
10
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
10
11
|
<objProp>
|
11
12
|
<name>saveConfig</name>
|
@@ -3,9 +3,10 @@ module RubyJmeter
|
|
3
3
|
class ResponseTimesPercentiles
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'ResponseTimesPercentiles' : (params[:name] || 'ResponseTimesPercentiles')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesPercentilesGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{
|
9
|
+
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.ResponseTimesPercentilesGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
|
9
10
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
10
11
|
<objProp>
|
11
12
|
<name>saveConfig</name>
|
@@ -4,9 +4,9 @@ module RubyJmeter
|
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
6
|
def initialize(params={})
|
7
|
-
params
|
7
|
+
testname = params.kind_of?(Array) ? 'SteppingThreadGroup' : (params[:name] || 'SteppingThreadGroup')
|
8
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
9
|
-
<kg.apc.jmeter.threads.SteppingThreadGroup guiclass="kg.apc.jmeter.threads.SteppingThreadGroupGui" testclass="kg.apc.jmeter.threads.SteppingThreadGroup" testname="#{
|
9
|
+
<kg.apc.jmeter.threads.SteppingThreadGroup guiclass="kg.apc.jmeter.threads.SteppingThreadGroupGui" testclass="kg.apc.jmeter.threads.SteppingThreadGroup" testname="#{testname}" enabled="true">
|
10
10
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
11
11
|
<stringProp name="ThreadGroup.num_threads">#{params[:total_threads]}</stringProp>
|
12
12
|
<stringProp name="Threads initial delay">#{params[:initial_delay]}</stringProp>
|
@@ -3,9 +3,10 @@ module RubyJmeter
|
|
3
3
|
class TransactionsPerSecond
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'TransactionsPerSecond' : (params[:name] || 'TransactionsPerSecond')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.TransactionsPerSecondGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{
|
9
|
+
<kg.apc.jmeter.vizualizers.CorrectedResultCollector guiclass="kg.apc.jmeter.vizualizers.TransactionsPerSecondGui" testclass="kg.apc.jmeter.vizualizers.CorrectedResultCollector" testname="#{testname}" enabled="#{enabled(params)}">
|
9
10
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
10
11
|
<objProp>
|
11
12
|
<name>saveConfig</name>
|
@@ -4,8 +4,9 @@ module RubyJmeter
|
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
6
|
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'UltimateThreadGroup' : (params[:name] || 'UltimateThreadGroup')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.threads.UltimateThreadGroup guiclass="kg.apc.jmeter.threads.UltimateThreadGroupGui" testclass="kg.apc.jmeter.threads.UltimateThreadGroup" testname="
|
9
|
+
<kg.apc.jmeter.threads.UltimateThreadGroup guiclass="kg.apc.jmeter.threads.UltimateThreadGroupGui" testclass="kg.apc.jmeter.threads.UltimateThreadGroup" testname="#{testname}" enabled="true">
|
9
10
|
<collectionProp name="ultimatethreadgroupdata">
|
10
11
|
</collectionProp>
|
11
12
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
|
@@ -3,13 +3,14 @@ module RubyJmeter
|
|
3
3
|
class ThroughputShapingTimer
|
4
4
|
attr_accessor :doc
|
5
5
|
include Helper
|
6
|
-
def initialize(
|
6
|
+
def initialize(params={})
|
7
|
+
testname = params.kind_of?(Array) ? 'ThroughputShapingTimer' : (params[:name] || 'ThroughputShapingTimer')
|
7
8
|
@doc = Nokogiri::XML(<<-EOF.strip_heredoc)
|
8
|
-
<kg.apc.jmeter.timers.VariableThroughputTimer guiclass="kg.apc.jmeter.timers.VariableThroughputTimerGui" testclass="kg.apc.jmeter.timers.VariableThroughputTimer" testname="#{
|
9
|
+
<kg.apc.jmeter.timers.VariableThroughputTimer guiclass="kg.apc.jmeter.timers.VariableThroughputTimerGui" testclass="kg.apc.jmeter.timers.VariableThroughputTimer" testname="#{testname}" enabled="true">
|
9
10
|
<collectionProp name="load_profile"/>
|
10
11
|
</kg.apc.jmeter.timers.VariableThroughputTimer>
|
11
12
|
EOF
|
12
|
-
steps.each_with_index do |step, index|
|
13
|
+
(params.kind_of?(Array) ? params : params[:steps]).each_with_index do |step, index|
|
13
14
|
@doc.at_xpath('//collectionProp') <<
|
14
15
|
Nokogiri::XML(<<-EOF.strip_heredoc).children
|
15
16
|
<collectionProp name="step_#{index}">
|
data/lib/ruby-jmeter/version.rb
CHANGED
data/spec/jmeter_plugins_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-jmeter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Koopmans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|