ruby-jmeter 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/basic_run.rb +12 -0
- data/examples/real_flood_test_data.rb +11 -0
- data/lib/ruby-jmeter/dsl.rb +3 -2
- data/lib/ruby-jmeter/version.rb +1 -1
- metadata +4 -2
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
require 'ruby-jmeter'
|
3
|
+
|
4
|
+
test do
|
5
|
+
threads count: 1 do
|
6
|
+
visit name: 'Home Page', url: 'http://google.com/'
|
7
|
+
end
|
8
|
+
end.run(
|
9
|
+
path: '/usr/share/jmeter/bin/',
|
10
|
+
debug: true,
|
11
|
+
properties: '/usr/share/jmeter/bin/jmeter.properties'
|
12
|
+
)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'ruby-jmeter'
|
2
|
+
|
3
|
+
test do
|
4
|
+
threads 1 do
|
5
|
+
get name: '__testdata', url: 'http://54.252.206.143:8080/SRANDMEMBER/postcodes?type=text' do
|
6
|
+
extract name: 'postcode', regex: '^.+?"(\d+)"'
|
7
|
+
end
|
8
|
+
visit name: 'Search Post Code', url: 'http://google.com/?q=${postcode}'
|
9
|
+
end
|
10
|
+
# end.flood(ENV['FLOOD_API_TOKEN'], {region: 'us-west-2'})
|
11
|
+
end.run(path: '/usr/share/jmeter/bin/', gui: true)
|
data/lib/ruby-jmeter/dsl.rb
CHANGED
@@ -331,9 +331,10 @@ module RubyJmeter
|
|
331
331
|
def run(params={})
|
332
332
|
file(params)
|
333
333
|
logger.warn "Test executing locally ..."
|
334
|
-
|
334
|
+
properties = params[:properties] || "#{File.dirname(__FILE__)}/helpers/jmeter.properties"
|
335
|
+
cmd = "#{params[:path]}jmeter #{"-n" unless params[:gui] } -t #{params[:file]} -j #{params[:log] ? params[:log] : 'jmeter.log' } -l #{params[:jtl] ? params[:jtl] : 'jmeter.jtl' } -q #{properties}"
|
335
336
|
logger.debug cmd if params[:debug]
|
336
|
-
Open3.popen2e("#{cmd}
|
337
|
+
Open3.popen2e("#{cmd}") do |stdin, stdout_err, wait_thr|
|
337
338
|
while line = stdout_err.gets
|
338
339
|
logger.debug line.chomp if params[:debug]
|
339
340
|
end
|
data/lib/ruby-jmeter/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-jmeter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.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-09-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -74,12 +74,14 @@ files:
|
|
74
74
|
- examples/basic_ldap_ext.rb
|
75
75
|
- examples/basic_post.rb
|
76
76
|
- examples/basic_query_params.rb
|
77
|
+
- examples/basic_run.rb
|
77
78
|
- examples/basic_simple_data_writer.rb
|
78
79
|
- examples/basic_think_time.rb
|
79
80
|
- examples/basic_throughput_controller.rb
|
80
81
|
- examples/basic_throughput_shaping_timer.rb
|
81
82
|
- examples/basic_user_defined_variables.rb
|
82
83
|
- examples/etsy_login_browse.rb
|
84
|
+
- examples/real_flood_test_data.rb
|
83
85
|
- examples/real_immi.gov.au_visa.rb
|
84
86
|
- lib/ruby-jmeter.rb
|
85
87
|
- lib/ruby-jmeter/DSL.md
|