wdbomber 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29b467e9675d95efed66253bb560ce677bca5180b3151fa7c28ed2c1afea28b0
4
- data.tar.gz: f3c40a8430201f6dc93e716e207f70e494178526d3e9c1190d1ae8ffb5afe94b
3
+ metadata.gz: 60a747bc8cddc1b9d20718682f4faeb968d1ea05a111cf314645ec1222f020d6
4
+ data.tar.gz: 68a002a76530ecf98f4bc2274698eb15c50c1bf04a069ec72d8b9fb92363cf4e
5
5
  SHA512:
6
- metadata.gz: 7acde9ceaad2dded9e953a6c018f2daae28a480bf955b809f7ab432b57af7f11cdc0d1d8139af89fca4a17097e63c9e4ba498403bddd139146e6a225a5ea8457
7
- data.tar.gz: 32e97f1f5c1b268a06ad021608d59332a8457cc148a40f2776794b577657b8de2901cca57be950078ccedea7cf84f2ca1845a51a6b28624e7883f799420d06f3
6
+ metadata.gz: 2c79f86890a6ffbb6fb5113d867de32db64430b50cb09589ed84b2e3b2c9054c602bd87741d4556168c82f15feebbbf13e66b83794a0c530ed0ca2ed3025ce7a
7
+ data.tar.gz: ba30856aa14176651b7881ea73a26324b8070f5130bb85a35876eac091c8ec36032021ab23b2a594b596dc1d05f06f51f9d2f60e9b25039de2a770689c0cf811
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wdbomber (0.1.1)
4
+ wdbomber (0.1.2)
5
5
  superbot-selenium-webdriver
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # wdbomber
2
2
 
3
3
  $ gem install wdbomber
4
- $ wdbomber URL iterations concurrency actions
4
+ $ wdbomber URL iterations concurrency actions rampup
5
5
 
data/exe/wdbomber CHANGED
@@ -11,7 +11,7 @@ STDOUT.sync = true
11
11
  require 'wdbomber'
12
12
 
13
13
  unless ARGV[0]
14
- puts "wdbomber URL iterations concurrency actions"
14
+ puts "wdbomber URL iterations concurrency actions rampup"
15
15
  exit 1
16
16
  end
17
17
 
@@ -19,5 +19,6 @@ endpoint = ARGV[0]
19
19
  iterations = ARGV[1] ? Integer(ARGV[1]) : 0
20
20
  concurrency = ARGV[2] ? Integer(ARGV[2]) : 1
21
21
  actions = ARGV[3] ? Integer(ARGV[3]) : 1
22
+ rampup = ARGV[4] ? Integer(ARGV[4]) : nil
22
23
 
23
- Wdbomber.run! endpoint, iterations: iterations, concurrency: concurrency, actions: actions
24
+ Wdbomber.run! endpoint, iterations: iterations, concurrency: concurrency, actions: actions, rampup: rampup
@@ -1,3 +1,3 @@
1
1
  module Wdbomber
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/wdbomber.rb CHANGED
@@ -12,8 +12,12 @@ Signal.trap("INT") {
12
12
  }
13
13
 
14
14
  module Wdbomber
15
- def self.run!(endpoint, iterations:, concurrency:1, concurrency_delay:0, actions:1)
16
- STDERR.puts "attacking #{endpoint} #{iterations} times with #{concurrency} bombers"
15
+ def self.run!(endpoint, iterations:, concurrency:1, concurrency_delay:0, actions:1, rampup: nil)
16
+ STDERR.puts "attacking #{endpoint}"
17
+ STDERR.puts " iterations: #{iterations}"
18
+ STDERR.puts " concurrency: #{concurrency}"
19
+ STDERR.puts " actions: #{actions}"
20
+ STDERR.puts " rampup: #{rampup}"
17
21
 
18
22
  desired_capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
19
23
  if ENV["SUPERBOT_REGION"]
@@ -27,6 +31,12 @@ module Wdbomber
27
31
  sleep t*concurrency_delay #for specs
28
32
 
29
33
  threads << Thread.new do
34
+ if rampup
35
+ my_rampup = rand(rampup).floor
36
+ puts "#{bomber}: starting after #{my_rampup} rampup"
37
+ sleep my_rampup
38
+ puts "#{bomber}: started"
39
+ end
30
40
  iterations.times do |i|
31
41
  if $SHUTDOWN_REQUESTED
32
42
  puts "#{bomber}: SHUTDOWN"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wdbomber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matti Paksula