simple_perf 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/simple_perf/cli/deploy.rb +1 -1
- data/lib/simple_perf/cli/deploy_gatling.rb +1 -1
- data/lib/simple_perf/cli/start_custom.rb +40 -0
- data/lib/simple_perf/cli/start_gatling.rb +1 -1
- data/lib/simple_perf/cli/{start.rb → start_jmeter.rb} +3 -3
- data/lib/simple_perf/cli.rb +8 -5
- data/lib/simple_perf/cloud_formation_templates/instance_group.json +2 -2
- data/lib/simple_perf/cloud_formation_templates/instance_group_gatling.json +4 -4
- data/lib/simple_perf/version.rb +1 -1
- metadata +4 -3
@@ -81,7 +81,7 @@ EOS
|
|
81
81
|
command = 'simple_deploy execute' +
|
82
82
|
' -e ' + opts[:environment] +
|
83
83
|
' -n ' + opts[:name] +
|
84
|
-
' -c "cd ~/
|
84
|
+
' -c "cd ~/simple_perf_test_files; unzip -o "' + file_name +
|
85
85
|
' -l debug'
|
86
86
|
|
87
87
|
Shared::pretty_print `#{command}`
|
@@ -81,7 +81,7 @@ EOS
|
|
81
81
|
command = 'simple_deploy execute' +
|
82
82
|
' -e ' + opts[:environment] +
|
83
83
|
' -n ' + opts[:name] +
|
84
|
-
' -c "cd ~/
|
84
|
+
' -c "cd ~/simple_perf_test_files; tar xvfz "' + file_name +
|
85
85
|
' -l debug'
|
86
86
|
|
87
87
|
Shared::pretty_print `#{command}`
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'trollop'
|
2
|
+
|
3
|
+
module SimplePerf
|
4
|
+
module CLI
|
5
|
+
class StartCustom
|
6
|
+
include Shared
|
7
|
+
|
8
|
+
def execute
|
9
|
+
opts = Trollop::options do
|
10
|
+
version SimplePerf::VERSION
|
11
|
+
banner <<-EOS
|
12
|
+
|
13
|
+
Starts JMeter or Gatling with custom shell script.
|
14
|
+
|
15
|
+
Usage:
|
16
|
+
simple_perf start_custom -e ENVIRONMENT -n STACK_NAME
|
17
|
+
EOS
|
18
|
+
opt :help, "Display Help"
|
19
|
+
opt :environment, "Set the target environment", :type => :string
|
20
|
+
opt :name, "Stack name to manage", :type => :string
|
21
|
+
end
|
22
|
+
Trollop::die :environment, "is required but not specified" unless opts[:environment]
|
23
|
+
Trollop::die :name, "is required but not specified" unless opts[:name]
|
24
|
+
|
25
|
+
config = Config.new.environment opts[:environment]
|
26
|
+
|
27
|
+
ENV['SIMPLE_DEPLOY_SSH_KEY'] = config['local_pem']
|
28
|
+
ENV['SIMPLE_DEPLOY_SSH_USER'] = config['user']
|
29
|
+
|
30
|
+
command = 'simple_deploy execute' +
|
31
|
+
' -e ' + opts[:environment] +
|
32
|
+
' -n ' + opts[:name] +
|
33
|
+
' -c "cd ~/simple_perf_test_files; nohup ./start_custom.sh > start_custom.log &"' +
|
34
|
+
' -l debug'
|
35
|
+
|
36
|
+
Shared::pretty_print `#{command}`
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -32,7 +32,7 @@ EOS
|
|
32
32
|
command = 'simple_deploy execute' +
|
33
33
|
' -e ' + opts[:environment] +
|
34
34
|
' -n ' + opts[:name] +
|
35
|
-
' -c "cd ~/
|
35
|
+
' -c "cd ~/simple_perf_test_files; nohup ./gatling.sh ' + opts[:simulation] + ' < input > gatling.log &"' +
|
36
36
|
' -l debug'
|
37
37
|
|
38
38
|
Shared::pretty_print `#{command}`
|
@@ -2,7 +2,7 @@ require 'trollop'
|
|
2
2
|
|
3
3
|
module SimplePerf
|
4
4
|
module CLI
|
5
|
-
class
|
5
|
+
class StartJmeter
|
6
6
|
include Shared
|
7
7
|
|
8
8
|
def execute
|
@@ -13,7 +13,7 @@ module SimplePerf
|
|
13
13
|
Starts JMeter java processes.
|
14
14
|
|
15
15
|
Usage:
|
16
|
-
simple_perf
|
16
|
+
simple_perf start_jmeter -e ENVIRONMENT -n STACK_NAME -t JMETER_TEST_PLAN
|
17
17
|
EOS
|
18
18
|
opt :help, "Display Help"
|
19
19
|
opt :environment, "Set the target environment", :type => :string
|
@@ -32,7 +32,7 @@ EOS
|
|
32
32
|
command = 'simple_deploy execute' +
|
33
33
|
' -e ' + opts[:environment] +
|
34
34
|
' -n ' + opts[:name] +
|
35
|
-
' -c "cd ~/
|
35
|
+
' -c "cd ~/simple_perf_test_files; nohup jmeter -Dsun.net.inetaddr.ttl=60 -n -t ' + opts[:testplan] + ' </dev/null >/dev/null 2>&1 &"' +
|
36
36
|
' -l debug'
|
37
37
|
|
38
38
|
Shared::pretty_print `#{command}`
|
data/lib/simple_perf/cli.rb
CHANGED
@@ -2,7 +2,6 @@ require 'trollop'
|
|
2
2
|
|
3
3
|
require 'simple_perf/cli/shared'
|
4
4
|
|
5
|
-
require 'simple_perf/cli/start'
|
6
5
|
require 'simple_perf/cli/stop'
|
7
6
|
require 'simple_perf/cli/deploy'
|
8
7
|
require 'simple_perf/cli/create'
|
@@ -14,7 +13,9 @@ require 'simple_perf/cli/update'
|
|
14
13
|
require 'simple_perf/cli/chaos'
|
15
14
|
require 'simple_perf/cli/create_gatling'
|
16
15
|
require 'simple_perf/cli/deploy_gatling'
|
16
|
+
require 'simple_perf/cli/start_jmeter'
|
17
17
|
require 'simple_perf/cli/start_gatling'
|
18
|
+
require 'simple_perf/cli/start_custom'
|
18
19
|
|
19
20
|
module SimplePerf
|
20
21
|
module CLI
|
@@ -22,10 +23,12 @@ module SimplePerf
|
|
22
23
|
cmd = ARGV.shift
|
23
24
|
|
24
25
|
case cmd
|
25
|
-
when '
|
26
|
-
CLI::
|
26
|
+
when 'start_jmeter'
|
27
|
+
CLI::StartJmeter.new.execute
|
27
28
|
when 'start_gatling'
|
28
29
|
CLI::StartGatling.new.execute
|
30
|
+
when 'start_custom'
|
31
|
+
CLI::StartCustom.new.execute
|
29
32
|
when 'stop'
|
30
33
|
CLI::Stop.new.execute
|
31
34
|
when 'deploy'
|
@@ -49,13 +52,13 @@ module SimplePerf
|
|
49
52
|
when 'chaos'
|
50
53
|
CLI::Chaos.new.execute
|
51
54
|
when '-h'
|
52
|
-
puts "simple_perf [
|
55
|
+
puts "simple_perf [start_jmeter|start_gatling|start_custom|stop|deploy|deploy_gatling|create|create_gatling|create_bucket|destroy|status|results|update|chaos] [options]"
|
53
56
|
puts "Append -h for help on specific subcommand."
|
54
57
|
when '-v'
|
55
58
|
puts SimplePerf::VERSION
|
56
59
|
else
|
57
60
|
puts "Unknown command: '#{cmd}'."
|
58
|
-
puts "simple_perf [
|
61
|
+
puts "simple_perf [start_jmeter|start_gatling|start_custom|stop|deploy|deploy_gatling|create|create_gatling|create_bucket|destroy|status|results|update|chaos] [options]"
|
59
62
|
puts "Append -h for help on specific subcommand."
|
60
63
|
exit 1
|
61
64
|
end
|
@@ -219,8 +219,8 @@
|
|
219
219
|
|
220
220
|
"/home/ec2-user/sync_jmeter_files.sh": {
|
221
221
|
"content": { "Fn::Join": [ "", [ "#!/bin/bash", "\n",
|
222
|
-
"mkdir -p ~/
|
223
|
-
"cd ~/
|
222
|
+
"mkdir -p ~/simple_perf_test_files", "\n",
|
223
|
+
"cd ~/simple_perf_test_files", "\n",
|
224
224
|
"s3cmd sync s3://",
|
225
225
|
{ "Ref": "S3BucketName" },
|
226
226
|
" ." ] ] },
|
@@ -195,8 +195,8 @@
|
|
195
195
|
|
196
196
|
"/home/ec2-user/sync_gatling_files.sh": {
|
197
197
|
"content": { "Fn::Join": [ "", [ "#!/bin/bash", "\n",
|
198
|
-
"mkdir -p ~/
|
199
|
-
"cd ~/
|
198
|
+
"mkdir -p ~/simple_perf_test_files", "\n",
|
199
|
+
"cd ~/simple_perf_test_files", "\n",
|
200
200
|
"s3cmd sync s3://",
|
201
201
|
{ "Ref": "S3BucketName" },
|
202
202
|
" ." ] ] },
|
@@ -208,7 +208,7 @@
|
|
208
208
|
"/home/ec2-user/gatling_test_files/gatling.sh": {
|
209
209
|
"content": { "Fn::Join": [ "", [ "#!/bin/bash", "\n",
|
210
210
|
"export GATLING_HOME=/opt/gatling", "\n",
|
211
|
-
"$GATLING_HOME/bin/gatling.sh -df ~/
|
211
|
+
"$GATLING_HOME/bin/gatling.sh -df ~/simple_perf_test_files/user-files/data -sf ~/simple_perf_test_files/user-files/simulations -s $1", "\n" ] ] },
|
212
212
|
"owner": "ec2-user",
|
213
213
|
"group": "ec2-user",
|
214
214
|
"mode": "000770"
|
@@ -256,7 +256,7 @@
|
|
256
256
|
" --secret-key=", { "Fn::GetAtt": ["UserKey", "SecretAccessKey"] }, "\n",
|
257
257
|
|
258
258
|
"runuser -c \"chown -R ec2-user:ec2-user /opt/gatling\" root", "\n",
|
259
|
-
"runuser -c \"chown -R ec2-user:ec2-user /home/ec2-user/
|
259
|
+
"runuser -c \"chown -R ec2-user:ec2-user /home/ec2-user/simple_perf_test_files\" root", "\n",
|
260
260
|
|
261
261
|
"/opt/aws/bin/cfn-signal -e ",
|
262
262
|
{ "Fn::FindInMap": [ "BootstrapSettingMap", "abort", { "Ref": "Abort" } ] },
|
data/lib/simple_perf/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_perf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
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-09-
|
12
|
+
date: 2013-09-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -119,8 +119,9 @@ files:
|
|
119
119
|
- lib/simple_perf/cli/destroy.rb
|
120
120
|
- lib/simple_perf/cli/results.rb
|
121
121
|
- lib/simple_perf/cli/shared.rb
|
122
|
-
- lib/simple_perf/cli/
|
122
|
+
- lib/simple_perf/cli/start_custom.rb
|
123
123
|
- lib/simple_perf/cli/start_gatling.rb
|
124
|
+
- lib/simple_perf/cli/start_jmeter.rb
|
124
125
|
- lib/simple_perf/cli/status.rb
|
125
126
|
- lib/simple_perf/cli/stop.rb
|
126
127
|
- lib/simple_perf/cli/update.rb
|