autosiege 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/autosiege/cli.rb +14 -5
- data/lib/autosiege/version.rb +1 -1
- metadata +3 -3
data/lib/autosiege/cli.rb
CHANGED
@@ -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
|
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
|
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
|
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
|
-
|
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
|
|
data/lib/autosiege/version.rb
CHANGED
metadata
CHANGED