ruby-jmeter 2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitattributes +22 -0
- data/.gitignore +22 -0
- data/.rspec +2 -0
- data/Gemfile +27 -0
- data/LICENSE.txt +22 -0
- data/README.md +333 -0
- data/Rakefile +6 -0
- data/bin/grid +25 -0
- data/examples/basic_assertion.rb +13 -0
- data/examples/basic_auth.rb +11 -0
- data/examples/basic_cache.rb +11 -0
- data/examples/basic_cookies.rb +11 -0
- data/examples/basic_extract.rb +10 -0
- data/examples/basic_gc_dummy_sampler.rb +10 -0
- data/examples/basic_gc_results.rb +23 -0
- data/examples/basic_google.rb +8 -0
- data/examples/basic_grid.rb +8 -0
- data/examples/basic_header.rb +19 -0
- data/examples/basic_ldap_ext.rb +16 -0
- data/examples/basic_post.rb +15 -0
- data/examples/basic_query_params.rb +8 -0
- data/examples/basic_think_time.rb +15 -0
- data/examples/basic_throughput_controller.rb +14 -0
- data/examples/basic_throughput_shaping_timer.rb +21 -0
- data/examples/etsy_login_browse.rb +64 -0
- data/lib/ruby-jmeter.rb +18 -0
- data/lib/ruby-jmeter/DSL.md +237 -0
- data/lib/ruby-jmeter/dsl.rb +419 -0
- data/lib/ruby-jmeter/dsl/access_log_sampler.rb +32 -0
- data/lib/ruby-jmeter/dsl/aggregate_graph.rb +55 -0
- data/lib/ruby-jmeter/dsl/aggregate_report.rb +55 -0
- data/lib/ruby-jmeter/dsl/ajp13_sampler.rb +41 -0
- data/lib/ruby-jmeter/dsl/assertion_results.rb +55 -0
- data/lib/ruby-jmeter/dsl/beanshell_assertion.rb +28 -0
- data/lib/ruby-jmeter/dsl/beanshell_listener.rb +28 -0
- data/lib/ruby-jmeter/dsl/beanshell_postprocessor.rb +28 -0
- data/lib/ruby-jmeter/dsl/beanshell_preprocessor.rb +28 -0
- data/lib/ruby-jmeter/dsl/beanshell_sampler.rb +28 -0
- data/lib/ruby-jmeter/dsl/beanshell_timer.rb +28 -0
- data/lib/ruby-jmeter/dsl/bsf_assertion.rb +28 -0
- data/lib/ruby-jmeter/dsl/bsf_listener.rb +28 -0
- data/lib/ruby-jmeter/dsl/bsf_postprocessor.rb +28 -0
- data/lib/ruby-jmeter/dsl/bsf_preprocessor.rb +28 -0
- data/lib/ruby-jmeter/dsl/bsf_sampler.rb +28 -0
- data/lib/ruby-jmeter/dsl/bsf_timer.rb +28 -0
- data/lib/ruby-jmeter/dsl/compare_assertion.rb +27 -0
- data/lib/ruby-jmeter/dsl/comparison_assertion_visualizer.rb +55 -0
- data/lib/ruby-jmeter/dsl/constant_throughput_timer.rb +30 -0
- data/lib/ruby-jmeter/dsl/constant_timer.rb +25 -0
- data/lib/ruby-jmeter/dsl/counter.rb +31 -0
- data/lib/ruby-jmeter/dsl/cssjquery_extractor.rb +30 -0
- data/lib/ruby-jmeter/dsl/csv_data_set_config.rb +32 -0
- data/lib/ruby-jmeter/dsl/debug_postprocessor.rb +28 -0
- data/lib/ruby-jmeter/dsl/debug_sampler.rb +27 -0
- data/lib/ruby-jmeter/dsl/distribution_graphalpha.rb +55 -0
- data/lib/ruby-jmeter/dsl/duration_assertion.rb +25 -0
- data/lib/ruby-jmeter/dsl/foreach_controller.rb +29 -0
- data/lib/ruby-jmeter/dsl/ftp_request.rb +34 -0
- data/lib/ruby-jmeter/dsl/ftp_request_defaults.rb +32 -0
- data/lib/ruby-jmeter/dsl/gaussian_random_timer.rb +26 -0
- data/lib/ruby-jmeter/dsl/generate_summary_results.rb +23 -0
- data/lib/ruby-jmeter/dsl/graph_results.rb +55 -0
- data/lib/ruby-jmeter/dsl/html_assertion.rb +30 -0
- data/lib/ruby-jmeter/dsl/html_link_parser.rb +23 -0
- data/lib/ruby-jmeter/dsl/html_parameter_mask.rb +32 -0
- data/lib/ruby-jmeter/dsl/http_authorization_manager.rb +33 -0
- data/lib/ruby-jmeter/dsl/http_cache_manager.rb +26 -0
- data/lib/ruby-jmeter/dsl/http_cookie_manager.rb +27 -0
- data/lib/ruby-jmeter/dsl/http_header_manager.rb +30 -0
- data/lib/ruby-jmeter/dsl/http_request.rb +41 -0
- data/lib/ruby-jmeter/dsl/http_request_defaults.rb +44 -0
- data/lib/ruby-jmeter/dsl/http_url_rewriting_modifier.rb +29 -0
- data/lib/ruby-jmeter/dsl/if_controller.rb +27 -0
- data/lib/ruby-jmeter/dsl/include_controller.rb +25 -0
- data/lib/ruby-jmeter/dsl/java_request.rb +69 -0
- data/lib/ruby-jmeter/dsl/java_request_defaults.rb +69 -0
- data/lib/ruby-jmeter/dsl/jdbc_connection_configuration.rb +37 -0
- data/lib/ruby-jmeter/dsl/jdbc_postprocessor.rb +31 -0
- data/lib/ruby-jmeter/dsl/jdbc_preprocessor.rb +31 -0
- data/lib/ruby-jmeter/dsl/jdbc_request.rb +31 -0
- data/lib/ruby-jmeter/dsl/jms_pointtopoint.rb +40 -0
- data/lib/ruby-jmeter/dsl/jms_publisher.rb +41 -0
- data/lib/ruby-jmeter/dsl/jms_subscriber.rb +35 -0
- data/lib/ruby-jmeter/dsl/jsr223_assertion.rb +29 -0
- data/lib/ruby-jmeter/dsl/jsr223_listener.rb +29 -0
- data/lib/ruby-jmeter/dsl/jsr223_postprocessor.rb +29 -0
- data/lib/ruby-jmeter/dsl/jsr223_preprocessor.rb +29 -0
- data/lib/ruby-jmeter/dsl/jsr223_sampler.rb +29 -0
- data/lib/ruby-jmeter/dsl/jsr223_timer.rb +29 -0
- data/lib/ruby-jmeter/dsl/junit_request.rb +37 -0
- data/lib/ruby-jmeter/dsl/keystore_configuration.rb +27 -0
- data/lib/ruby-jmeter/dsl/ldap_extended_request.rb +42 -0
- data/lib/ruby-jmeter/dsl/ldap_extended_request_defaults.rb +42 -0
- data/lib/ruby-jmeter/dsl/ldap_request.rb +35 -0
- data/lib/ruby-jmeter/dsl/ldap_request_defaults.rb +40 -0
- data/lib/ruby-jmeter/dsl/login_config_element.rb +26 -0
- data/lib/ruby-jmeter/dsl/loop_controller.rb +26 -0
- data/lib/ruby-jmeter/dsl/mail_reader_sampler.rb +37 -0
- data/lib/ruby-jmeter/dsl/mailer_visualizer.rb +64 -0
- data/lib/ruby-jmeter/dsl/md5hex_assertion.rb +25 -0
- data/lib/ruby-jmeter/dsl/module_controller.rb +23 -0
- data/lib/ruby-jmeter/dsl/monitor_results.rb +55 -0
- data/lib/ruby-jmeter/dsl/once_only_controller.rb +23 -0
- data/lib/ruby-jmeter/dsl/os_process_sampler.rb +34 -0
- data/lib/ruby-jmeter/dsl/poisson_random_timer.rb +26 -0
- data/lib/ruby-jmeter/dsl/random_controller.rb +25 -0
- data/lib/ruby-jmeter/dsl/random_order_controller.rb +23 -0
- data/lib/ruby-jmeter/dsl/random_variable.rb +30 -0
- data/lib/ruby-jmeter/dsl/recording_controller.rb +23 -0
- data/lib/ruby-jmeter/dsl/regex_user_parameters.rb +27 -0
- data/lib/ruby-jmeter/dsl/regular_expression_extractor.rb +31 -0
- data/lib/ruby-jmeter/dsl/response_assertion.rb +31 -0
- data/lib/ruby-jmeter/dsl/response_time_graph.rb +55 -0
- data/lib/ruby-jmeter/dsl/result_status_action_handler.rb +25 -0
- data/lib/ruby-jmeter/dsl/runtime_controller.rb +25 -0
- data/lib/ruby-jmeter/dsl/save_responses_to_a_file.rb +29 -0
- data/lib/ruby-jmeter/dsl/simple_config_element.rb +23 -0
- data/lib/ruby-jmeter/dsl/simple_controller.rb +23 -0
- data/lib/ruby-jmeter/dsl/simple_data_writer.rb +55 -0
- data/lib/ruby-jmeter/dsl/smime_assertion.rb +35 -0
- data/lib/ruby-jmeter/dsl/smtp_sampler.rb +51 -0
- data/lib/ruby-jmeter/dsl/soapxmlrpc_request.rb +33 -0
- data/lib/ruby-jmeter/dsl/spline_visualizer.rb +55 -0
- data/lib/ruby-jmeter/dsl/summary_report.rb +55 -0
- data/lib/ruby-jmeter/dsl/switch_controller.rb +25 -0
- data/lib/ruby-jmeter/dsl/synchronizing_timer.rb +25 -0
- data/lib/ruby-jmeter/dsl/tcp_sampler.rb +33 -0
- data/lib/ruby-jmeter/dsl/tcp_sampler_config.rb +31 -0
- data/lib/ruby-jmeter/dsl/test_action.rb +27 -0
- data/lib/ruby-jmeter/dsl/test_plan.rb +31 -0
- data/lib/ruby-jmeter/dsl/thread_group.rb +36 -0
- data/lib/ruby-jmeter/dsl/throughput_controller.rb +32 -0
- data/lib/ruby-jmeter/dsl/transaction_controller.rb +26 -0
- data/lib/ruby-jmeter/dsl/uniform_random_timer.rb +26 -0
- data/lib/ruby-jmeter/dsl/user_defined_variables.rb +32 -0
- data/lib/ruby-jmeter/dsl/user_parameters.rb +29 -0
- data/lib/ruby-jmeter/dsl/view_results_in_table.rb +55 -0
- data/lib/ruby-jmeter/dsl/view_results_tree.rb +55 -0
- data/lib/ruby-jmeter/dsl/while_controller.rb +25 -0
- data/lib/ruby-jmeter/dsl/xml_assertion.rb +23 -0
- data/lib/ruby-jmeter/dsl/xml_schema_assertion.rb +25 -0
- data/lib/ruby-jmeter/dsl/xpath_assertion.rb +30 -0
- data/lib/ruby-jmeter/dsl/xpath_extractor.rb +30 -0
- data/lib/ruby-jmeter/helpers/fallback_content_proxy.rb +54 -0
- data/lib/ruby-jmeter/helpers/helper.rb +41 -0
- data/lib/ruby-jmeter/helpers/jmeter.properties +28 -0
- data/lib/ruby-jmeter/helpers/logger-colors.rb +48 -0
- data/lib/ruby-jmeter/helpers/parser.rb +106 -0
- data/lib/ruby-jmeter/helpers/strip-heredoc.rb +5 -0
- data/lib/ruby-jmeter/helpers/user-agents.rb +27 -0
- data/lib/ruby-jmeter/idl.rb +70 -0
- data/lib/ruby-jmeter/idl.xml +1513 -0
- data/lib/ruby-jmeter/plugins/gc_console_status_logger.rb +14 -0
- data/lib/ruby-jmeter/plugins/gc_dummy_sampler.rb +23 -0
- data/lib/ruby-jmeter/plugins/gc_latencies_over_time.rb +48 -0
- data/lib/ruby-jmeter/plugins/gc_response_codes_per_second.rb +48 -0
- data/lib/ruby-jmeter/plugins/gc_response_times_distribution.rb +47 -0
- data/lib/ruby-jmeter/plugins/gc_response_times_over_time.rb +48 -0
- data/lib/ruby-jmeter/plugins/gc_response_times_percentiles.rb +48 -0
- data/lib/ruby-jmeter/plugins/gc_transactions_per_second.rb +48 -0
- data/lib/ruby-jmeter/plugins/gc_variable_throughput_timer.rb +26 -0
- data/lib/ruby-jmeter/version.rb +3 -0
- data/ruby-jmeter.gemspec +22 -0
- data/spec/dsl_spec.rb +491 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/stub.rb +31 -0
- metadata +244 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def bsf_postprocessor(params={}, &block)
|
4
|
+
node = RubyJmeter::BsfPostprocessor.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class BsfPostprocessor
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'BsfPostprocessor'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<BSFPostProcessor guiclass="TestBeanGUI" testclass="BSFPostProcessor" testname="#{params[:name]}" enabled="true">
|
17
|
+
<stringProp name="filename"/>
|
18
|
+
<stringProp name="parameters"/>
|
19
|
+
<stringProp name="script"/>
|
20
|
+
<stringProp name="scriptLanguage"/>
|
21
|
+
</BSFPostProcessor>)
|
22
|
+
EOS
|
23
|
+
update params
|
24
|
+
update_at_xpath params if params[:update_at_xpath]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def bsf_preprocessor(params={}, &block)
|
4
|
+
node = RubyJmeter::BsfPreprocessor.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class BsfPreprocessor
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'BsfPreprocessor'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<BSFPreProcessor guiclass="TestBeanGUI" testclass="BSFPreProcessor" testname="#{params[:name]}" enabled="true">
|
17
|
+
<stringProp name="filename"/>
|
18
|
+
<stringProp name="parameters"/>
|
19
|
+
<stringProp name="script"/>
|
20
|
+
<stringProp name="scriptLanguage"/>
|
21
|
+
</BSFPreProcessor>)
|
22
|
+
EOS
|
23
|
+
update params
|
24
|
+
update_at_xpath params if params[:update_at_xpath]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def bsf_sampler(params={}, &block)
|
4
|
+
node = RubyJmeter::BsfSampler.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class BsfSampler
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'BsfSampler'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<BSFSampler guiclass="TestBeanGUI" testclass="BSFSampler" testname="#{params[:name]}" enabled="true">
|
17
|
+
<stringProp name="filename"/>
|
18
|
+
<stringProp name="parameters"/>
|
19
|
+
<stringProp name="script"/>
|
20
|
+
<stringProp name="scriptLanguage"/>
|
21
|
+
</BSFSampler>)
|
22
|
+
EOS
|
23
|
+
update params
|
24
|
+
update_at_xpath params if params[:update_at_xpath]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def bsf_timer(params={}, &block)
|
4
|
+
node = RubyJmeter::BsfTimer.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class BsfTimer
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'BsfTimer'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<BSFTimer guiclass="TestBeanGUI" testclass="BSFTimer" testname="#{params[:name]}" enabled="true">
|
17
|
+
<stringProp name="filename"/>
|
18
|
+
<stringProp name="parameters"/>
|
19
|
+
<stringProp name="script"/>
|
20
|
+
<stringProp name="scriptLanguage"/>
|
21
|
+
</BSFTimer>)
|
22
|
+
EOS
|
23
|
+
update params
|
24
|
+
update_at_xpath params if params[:update_at_xpath]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def compare_assertion(params={}, &block)
|
4
|
+
node = RubyJmeter::CompareAssertion.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class CompareAssertion
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'CompareAssertion'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<CompareAssertion guiclass="TestBeanGUI" testclass="CompareAssertion" testname="#{params[:name]}" enabled="true">
|
17
|
+
<boolProp name="compareContent">true</boolProp>
|
18
|
+
<longProp name="compareTime">-1</longProp>
|
19
|
+
<collectionProp name="stringsToSkip"/>
|
20
|
+
</CompareAssertion>)
|
21
|
+
EOS
|
22
|
+
update params
|
23
|
+
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def comparison_assertion_visualizer(params={}, &block)
|
4
|
+
node = RubyJmeter::ComparisonAssertionVisualizer.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class ComparisonAssertionVisualizer
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'ComparisonAssertionVisualizer'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<ResultCollector guiclass="ComparisonVisualizer" testclass="ResultCollector" testname="#{params[:name]}" enabled="true">
|
17
|
+
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
18
|
+
<objProp>
|
19
|
+
<name>saveConfig</name>
|
20
|
+
<value class="SampleSaveConfiguration">
|
21
|
+
<time>true</time>
|
22
|
+
<latency>true</latency>
|
23
|
+
<timestamp>true</timestamp>
|
24
|
+
<success>true</success>
|
25
|
+
<label>true</label>
|
26
|
+
<code>true</code>
|
27
|
+
<message>false</message>
|
28
|
+
<threadName>true</threadName>
|
29
|
+
<dataType>false</dataType>
|
30
|
+
<encoding>false</encoding>
|
31
|
+
<assertions>false</assertions>
|
32
|
+
<subresults>false</subresults>
|
33
|
+
<responseData>false</responseData>
|
34
|
+
<samplerData>false</samplerData>
|
35
|
+
<xml>false</xml>
|
36
|
+
<fieldNames>false</fieldNames>
|
37
|
+
<responseHeaders>false</responseHeaders>
|
38
|
+
<requestHeaders>false</requestHeaders>
|
39
|
+
<responseDataOnError>false</responseDataOnError>
|
40
|
+
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
|
41
|
+
<assertionsResultsToSave>0</assertionsResultsToSave>
|
42
|
+
<bytes>true</bytes>
|
43
|
+
<threadCounts>true</threadCounts>
|
44
|
+
<sampleCount>true</sampleCount>
|
45
|
+
</value>
|
46
|
+
</objProp>
|
47
|
+
<stringProp name="filename"/>
|
48
|
+
</ResultCollector>)
|
49
|
+
EOS
|
50
|
+
update params
|
51
|
+
update_at_xpath params if params[:update_at_xpath]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def constant_throughput_timer(params={}, &block)
|
4
|
+
node = RubyJmeter::ConstantThroughputTimer.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class ConstantThroughputTimer
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'ConstantThroughputTimer'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="#{params[:name]}" enabled="true">
|
17
|
+
<stringProp name="calcMode">this thread only</stringProp>
|
18
|
+
<doubleProp>
|
19
|
+
<name>throughput</name>
|
20
|
+
<value>0.0</value>
|
21
|
+
<savedValue>0.0</savedValue>
|
22
|
+
</doubleProp>
|
23
|
+
</ConstantThroughputTimer>)
|
24
|
+
EOS
|
25
|
+
update params
|
26
|
+
update_at_xpath params if params[:update_at_xpath]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def constant_timer(params={}, &block)
|
4
|
+
node = RubyJmeter::ConstantTimer.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class ConstantTimer
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'ConstantTimer'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="#{params[:name]}" enabled="true">
|
17
|
+
<stringProp name="ConstantTimer.delay">300</stringProp>
|
18
|
+
</ConstantTimer>)
|
19
|
+
EOS
|
20
|
+
update params
|
21
|
+
update_at_xpath params if params[:update_at_xpath]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def counter(params={}, &block)
|
4
|
+
node = RubyJmeter::Counter.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class Counter
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'Counter'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="#{params[:name]}" enabled="true">
|
17
|
+
<stringProp name="CounterConfig.start"/>
|
18
|
+
<stringProp name="CounterConfig.end"/>
|
19
|
+
<stringProp name="CounterConfig.incr"/>
|
20
|
+
<stringProp name="CounterConfig.name"/>
|
21
|
+
<stringProp name="CounterConfig.format"/>
|
22
|
+
<boolProp name="CounterConfig.per_user">true</boolProp>
|
23
|
+
<boolProp name="CounterConfig.reset_on_tg_iteration">true</boolProp>
|
24
|
+
</CounterConfig>)
|
25
|
+
EOS
|
26
|
+
update params
|
27
|
+
update_at_xpath params if params[:update_at_xpath]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def cssjquery_extractor(params={}, &block)
|
4
|
+
node = RubyJmeter::CssjqueryExtractor.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class CssjqueryExtractor
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'CssjqueryExtractor'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<HtmlExtractor guiclass="HtmlExtractorGui" testclass="HtmlExtractor" testname="#{params[:name]}" enabled="true">
|
17
|
+
<stringProp name="HtmlExtractor.refname"/>
|
18
|
+
<stringProp name="HtmlExtractor.expr"/>
|
19
|
+
<stringProp name="HtmlExtractor.attribute"/>
|
20
|
+
<stringProp name="HtmlExtractor.default"/>
|
21
|
+
<stringProp name="HtmlExtractor.match_number"/>
|
22
|
+
<stringProp name="HtmlExtractor.extractor_impl"/>
|
23
|
+
</HtmlExtractor>)
|
24
|
+
EOS
|
25
|
+
update params
|
26
|
+
update_at_xpath params if params[:update_at_xpath]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def csv_data_set_config(params={}, &block)
|
4
|
+
node = RubyJmeter::CsvDataSetConfig.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class CsvDataSetConfig
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'CsvDataSetConfig'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="#{params[:name]}" enabled="true">
|
17
|
+
<stringProp name="delimiter">,</stringProp>
|
18
|
+
<stringProp name="fileEncoding"/>
|
19
|
+
<stringProp name="filename"/>
|
20
|
+
<boolProp name="quotedData">false</boolProp>
|
21
|
+
<boolProp name="recycle">true</boolProp>
|
22
|
+
<stringProp name="shareMode">All threads</stringProp>
|
23
|
+
<boolProp name="stopThread">false</boolProp>
|
24
|
+
<stringProp name="variableNames"/>
|
25
|
+
</CSVDataSet>)
|
26
|
+
EOS
|
27
|
+
update params
|
28
|
+
update_at_xpath params if params[:update_at_xpath]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def debug_postprocessor(params={}, &block)
|
4
|
+
node = RubyJmeter::DebugPostprocessor.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class DebugPostprocessor
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'DebugPostprocessor'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<DebugPostProcessor guiclass="TestBeanGUI" testclass="DebugPostProcessor" testname="#{params[:name]}" enabled="true">
|
17
|
+
<boolProp name="displayJMeterProperties">false</boolProp>
|
18
|
+
<boolProp name="displayJMeterVariables">true</boolProp>
|
19
|
+
<boolProp name="displaySamplerProperties">true</boolProp>
|
20
|
+
<boolProp name="displaySystemProperties">false</boolProp>
|
21
|
+
</DebugPostProcessor>)
|
22
|
+
EOS
|
23
|
+
update params
|
24
|
+
update_at_xpath params if params[:update_at_xpath]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def debug_sampler(params={}, &block)
|
4
|
+
node = RubyJmeter::DebugSampler.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class DebugSampler
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'DebugSampler'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="#{params[:name]}" enabled="true">
|
17
|
+
<boolProp name="displayJMeterProperties">false</boolProp>
|
18
|
+
<boolProp name="displayJMeterVariables">true</boolProp>
|
19
|
+
<boolProp name="displaySystemProperties">false</boolProp>
|
20
|
+
</DebugSampler>)
|
21
|
+
EOS
|
22
|
+
update params
|
23
|
+
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module RubyJmeter
|
2
|
+
class DSL
|
3
|
+
def distribution_graphalpha(params={}, &block)
|
4
|
+
node = RubyJmeter::DistributionGraphalpha.new(params)
|
5
|
+
attach_node(node, &block)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class DistributionGraphalpha
|
10
|
+
attr_accessor :doc
|
11
|
+
include Helper
|
12
|
+
|
13
|
+
def initialize(params={})
|
14
|
+
params[:name] ||= 'DistributionGraphalpha'
|
15
|
+
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
+
<ResultCollector guiclass="DistributionGraphVisualizer" testclass="ResultCollector" testname="#{params[:name]}" enabled="true">
|
17
|
+
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
18
|
+
<objProp>
|
19
|
+
<name>saveConfig</name>
|
20
|
+
<value class="SampleSaveConfiguration">
|
21
|
+
<time>true</time>
|
22
|
+
<latency>true</latency>
|
23
|
+
<timestamp>true</timestamp>
|
24
|
+
<success>true</success>
|
25
|
+
<label>true</label>
|
26
|
+
<code>true</code>
|
27
|
+
<message>false</message>
|
28
|
+
<threadName>true</threadName>
|
29
|
+
<dataType>false</dataType>
|
30
|
+
<encoding>false</encoding>
|
31
|
+
<assertions>false</assertions>
|
32
|
+
<subresults>false</subresults>
|
33
|
+
<responseData>false</responseData>
|
34
|
+
<samplerData>false</samplerData>
|
35
|
+
<xml>false</xml>
|
36
|
+
<fieldNames>false</fieldNames>
|
37
|
+
<responseHeaders>false</responseHeaders>
|
38
|
+
<requestHeaders>false</requestHeaders>
|
39
|
+
<responseDataOnError>false</responseDataOnError>
|
40
|
+
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
|
41
|
+
<assertionsResultsToSave>0</assertionsResultsToSave>
|
42
|
+
<bytes>true</bytes>
|
43
|
+
<threadCounts>true</threadCounts>
|
44
|
+
<sampleCount>true</sampleCount>
|
45
|
+
</value>
|
46
|
+
</objProp>
|
47
|
+
<stringProp name="filename"/>
|
48
|
+
</ResultCollector>)
|
49
|
+
EOS
|
50
|
+
update params
|
51
|
+
update_at_xpath params if params[:update_at_xpath]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|