em-http-test 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/em-http-test.gemspec +2 -2
- data/lib/em-http-test.rb +2 -1
- data/lib/em-http-test/load-test.rb +1 -0
- data/lib/em-http-test/test-runner.rb +6 -1
- data/lib/em-http-test/version.rb +1 -1
- metadata +7 -24
- data/Gemfile +0 -4
data/em-http-test.gemspec
CHANGED
@@ -17,9 +17,9 @@ Gem::Specification.new do |s|
|
|
17
17
|
#s.add_dependency "eventmachine", ">= 0.12.0"
|
18
18
|
s.add_dependency "em-http-request", ">= 0.3.0"
|
19
19
|
|
20
|
-
s.add_development_dependency "
|
20
|
+
#s.add_development_dependency "rake"
|
21
21
|
|
22
|
-
s.files =
|
22
|
+
s.files = Dir['lib/**/*.rb'] + Dir['*.gemspec'] + Dir['*.md']
|
23
23
|
#s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
24
24
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
25
25
|
s.require_paths = ["lib"]
|
data/lib/em-http-test.rb
CHANGED
@@ -16,6 +16,7 @@ require 'em-http-test/load-test'
|
|
16
16
|
require 'em-http-test/test-request'
|
17
17
|
|
18
18
|
module EventMachine::HttpTest
|
19
|
+
@@notifytimer = 10
|
19
20
|
|
20
21
|
# run a load test by executing the test block multiple times in the
|
21
22
|
# specified concurrency. The test will be executed for a total of runtime seconds
|
@@ -40,7 +41,7 @@ module EventMachine::HttpTest
|
|
40
41
|
test = LoadTest.new(concurrency) { block.call }
|
41
42
|
test.onsuccess { |t| stats[:success] += 1; stats[:total] += 1; successTimes << t }
|
42
43
|
test.onfailure { |t,e| stats[:failure] += 1; stats[:total] += 1; successTimes << t; stats[:failures] << e }
|
43
|
-
EventMachine.add_periodic_timer(
|
44
|
+
EventMachine.add_periodic_timer(@@notifytimer) { puts "#{stats[:total]} tests ran in #{(Time.new - startTime).to_i} seconds" }
|
44
45
|
EventMachine.add_timer(runtime) { test.abort }
|
45
46
|
end
|
46
47
|
|
@@ -14,13 +14,18 @@ module EventMachine::HttpTest
|
|
14
14
|
def initialize(f)
|
15
15
|
@fiber = f
|
16
16
|
@testreq = @fiber.resume # first call, so no data to test
|
17
|
+
@running = true
|
17
18
|
process
|
18
19
|
end
|
19
20
|
|
21
|
+
def abort
|
22
|
+
@running = false
|
23
|
+
end
|
24
|
+
|
20
25
|
# Run a step of the test by calling the test generated URL
|
21
26
|
# and submitting the results to be processed
|
22
27
|
def process
|
23
|
-
unless @fiber.alive?
|
28
|
+
unless @fiber.alive? and @running
|
24
29
|
# if the fiber has completed, then we succeeded
|
25
30
|
self.succeed()
|
26
31
|
return
|
data/lib/em-http-test/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: em-http-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -27,22 +27,6 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 0.3.0
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: rspec
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
30
|
description: EventMachine based, high performance web application load test framework
|
47
31
|
email:
|
48
32
|
- oded@heptagon.co.il
|
@@ -50,16 +34,15 @@ executables: []
|
|
50
34
|
extensions: []
|
51
35
|
extra_rdoc_files: []
|
52
36
|
files:
|
53
|
-
-
|
54
|
-
- README.md
|
55
|
-
- em-http-test.gemspec
|
56
|
-
- lib/em-http-test.rb
|
57
|
-
- lib/em-http-test/definitions.rb
|
37
|
+
- lib/em-http-test/version.rb
|
58
38
|
- lib/em-http-test/load-test.rb
|
59
|
-
- lib/em-http-test/
|
39
|
+
- lib/em-http-test/definitions.rb
|
60
40
|
- lib/em-http-test/test-request.rb
|
61
41
|
- lib/em-http-test/test-runner.rb
|
62
|
-
- lib/em-http-test/
|
42
|
+
- lib/em-http-test/test-failure.rb
|
43
|
+
- lib/em-http-test.rb
|
44
|
+
- em-http-test.gemspec
|
45
|
+
- README.md
|
63
46
|
homepage: https://github.com/guss77/em-http-test
|
64
47
|
licenses: []
|
65
48
|
post_install_message:
|
data/Gemfile
DELETED