ruby-jmeter 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/sample_transaction.rb +9 -0
- data/lib/ruby-jmeter/extend/samplers/http_request.rb +13 -3
- data/lib/ruby-jmeter/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b256922f13170dd4efd1c17832d1daaa194e1217
|
4
|
+
data.tar.gz: 3952525795c9227ca8c0c50c096eeb5fb6b6176f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a045e324e74468d232fa3e47ee38864a1a12c4640545b6da2cc9bc5381b1f280c9a067cb52c8ad97fa8e156e6934725f2b0a8bea2d61dabd2abe2fe1f03fe141
|
7
|
+
data.tar.gz: e645cc3f2e4737adb17b10fff3482376827e2c33b1c0a8fceeb77f2478b2b499bcbe6a88c646d7dc469fdd0ed8c9b4287a9a48ed3e3b56b02bc406eccfd956bb
|
@@ -0,0 +1,9 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
require 'ruby-jmeter'
|
3
|
+
|
4
|
+
test do
|
5
|
+
threads count: 1 do
|
6
|
+
# this will let you sample 1 in every N (e.g. 100) transactions on Flood IO
|
7
|
+
get name: 'Home Page', sample: 100, url: 'http://google.com/'
|
8
|
+
end
|
9
|
+
end.run(path: '/usr/share/jmeter/bin/', gui: true)
|
@@ -17,7 +17,19 @@ module RubyJmeter
|
|
17
17
|
|
18
18
|
parse_http_request(params)
|
19
19
|
|
20
|
-
|
20
|
+
if params[:sample]
|
21
|
+
transaction name: params[:name], parent: true do
|
22
|
+
loops count: params[:sample].to_i do
|
23
|
+
attach_node(http_request_node(params), &block)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
else
|
27
|
+
attach_node(http_request_node(params), &block)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def http_request_node(params)
|
32
|
+
RubyJmeter::HttpRequest.new(params).tap do |node|
|
21
33
|
node.doc.children.first.add_child (
|
22
34
|
Nokogiri::XML(<<-EOS.strip_heredoc).children
|
23
35
|
<stringProp name="HTTPSampler.implementation">#{params[:implementation]}</stringProp>
|
@@ -30,8 +42,6 @@ module RubyJmeter
|
|
30
42
|
EOS
|
31
43
|
) if params[:comments]
|
32
44
|
end
|
33
|
-
|
34
|
-
attach_node(node, &block)
|
35
45
|
end
|
36
46
|
|
37
47
|
alias request http_request
|
data/lib/ruby-jmeter/version.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.2
|
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-08-
|
11
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- examples/regular_expression_extractor.rb
|
90
90
|
- examples/response_assertion.rb
|
91
91
|
- examples/response_time_percentiles_graph.rb
|
92
|
+
- examples/sample_transaction.rb
|
92
93
|
- examples/simple_data_writer_listener.rb
|
93
94
|
- examples/stepping_thread_group.rb
|
94
95
|
- examples/test_fragment.rb
|