autosiege 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,18 +14,18 @@ module Autosiege
14
14
  :short => "-c CONFIG",
15
15
  :long => "--config CONFIG",
16
16
  :default => 'config/siege/siegerc',
17
- :description => "The siege configuration file to use (default: ./config/siege/siegerc)"
17
+ :description => "The siege configuration file to use, default is 'config/siege/siegerc'"
18
18
 
19
19
  option :urls_file,
20
20
  :short => "-u URLSFILE",
21
21
  :long => "--urls URLSFILE",
22
22
  :default => 'config/siege/urls.txt',
23
- :description => "The urls file to use (default: ./config/siege/urls.txt)"
23
+ :description => "The urls file to use, default is 'config/siege/urls.txt'"
24
24
 
25
25
  option :log_file,
26
26
  :short => "-l LOGFILE",
27
27
  :long => "--log LOGFILE",
28
- :description => "The log file location (default: ./log/siege.log)",
28
+ :description => "The log file location, default is 'log/siege.log'",
29
29
  :default => 'log/siege.log'
30
30
 
31
31
  option :help,
@@ -37,6 +37,12 @@ module Autosiege
37
37
  :show_options => true,
38
38
  :exit => 0
39
39
 
40
+ option :concurrency,
41
+ :short => "-c CONCURRENCY",
42
+ :long => "--concurrency CONCURRENCY",
43
+ :default => 25,
44
+ :description => "Number of concurrent users, default is 25"
45
+
40
46
  def self.run
41
47
  cli = new
42
48
  begin
@@ -55,14 +61,17 @@ module Autosiege
55
61
  exit 0
56
62
  else
57
63
  ENV['SIEGE_LOGFILE'] = config[:logfile]
58
- system "siege --concurrent=25 --internet --time 1m --reps=1 --rc=#{config[:urls_file]} --log --file=#{config[:config_file]}"
64
+ cmd = "siege --concurrent=#{config[:concurrency]} --internet --time 1m --rc=#{config[:config_file]} --log --file=#{config[:urls_file]}"
65
+ puts cmd
66
+ system cmd
59
67
  end
60
68
  end
61
69
 
62
70
  def setup
63
- system "mkdir -p config/siege"
64
71
  system "mkdir -p log"
72
+ system "touch log/siege.log"
65
73
 
74
+ system "mkdir -p config/siege"
66
75
  siegefile = File.expand_path("../../../conf/siegerc", __FILE__)
67
76
  system "cp #{siegefile} config/siege/siegerc"
68
77
 
@@ -1,3 +1,3 @@
1
1
  module Autosiege
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autosiege
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ben Marini