gargor 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -1
- data/Gemfile +3 -12
- data/README.md +11 -1
- data/VERSION +1 -1
- data/bin/gargor +2 -0
- data/gargor.gemspec +8 -0
- data/lib/gargor/cli.rb +0 -1
- data/spec/gargor_cli_spec.rb +2 -1
- data/spec/gargor_individual_spec.rb +3 -3
- data/spec/gargor_reporter_spec.rb +16 -0
- data/spec/gargor_spec.rb +2 -2
- data/spec/helper.rb +2 -2
- metadata +97 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4faf435571edb4966e66fc38f3c26926b349fc76
|
4
|
+
data.tar.gz: 01de2fe349d3aa6f231a5eda672167146431b289
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da78b02f31c6f3e0bdc903f4e942761fdd5579824e081081a331b51bc94be7ef620bf0d62288d11dbd1820310c4d0d14d98d7502b7888c48bfd17a67c2a2cd3e
|
7
|
+
data.tar.gz: b5ba74d83625a801730d69efb90208bc15e383ff9108e78f05283717dee4ba0a7e05e5fcdceb16839447faad3028761b37b1faa964b709d9d22474d545a064c1
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,27 +1,18 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gem "rake", "~> 10.1.0"
|
4
|
-
gem "json", "~> 1.8.0"
|
5
|
-
gem "jsonpath", "~> 0.5.3"
|
6
|
-
gem "progressbar", "~> 0.20.0"
|
7
|
-
gem "version", "~> 1.0.0"
|
8
|
-
gem "thor", "~> 0.18.1"
|
9
|
-
gem "terminal-table", "~> 1.4.5"
|
2
|
+
gemspec
|
10
3
|
|
11
4
|
group :development do
|
12
5
|
gem 'pry'
|
13
|
-
gem 'pry-
|
6
|
+
gem 'pry-byebug'
|
14
7
|
end
|
15
8
|
|
16
9
|
group :test, :development do
|
10
|
+
gem 'rake'
|
17
11
|
gem 'childlabor'
|
18
|
-
gem 'coveralls'
|
19
12
|
gem 'fakeweb'
|
20
13
|
gem 'rspec'
|
21
14
|
gem 'simplecov'
|
22
15
|
gem 'coveralls', require: false
|
23
16
|
end
|
24
17
|
|
25
|
-
# Specify your gem's dependencies in gargor.gemspec
|
26
|
-
gemspec
|
27
18
|
|
data/README.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
# gargor
|
1
|
+
# gargor
|
2
|
+
[![Build Status](https://travis-ci.org/tumf/gargor.png?branch=master)](https://travis-ci.org/tumf/gargor)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/gargor.png)](http://badge.fury.io/rb/gargor)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/tumf/gargor.png)](https://codeclimate.com/github/tumf/gargor)
|
5
|
+
[![Dependency Status](https://gemnasium.com/tumf/gargor.png)](https://gemnasium.com/tumf/gargor)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/tumf/gargor/badge.png)](https://coveralls.io/r/tumf/gargor)
|
7
|
+
[![Gitter chat](https://badges.gitter.im/tumf/gargor.png)](https://gitter.im/tumf/gargor)
|
2
8
|
|
3
9
|
`gargor` is software which uses genetic algorithm to support parameter tuning of the servers controlled by Chef.Using this software, you are able to optimize and automate the server tuning, which you did until now based on a combination of my experience and intuition.
|
4
10
|
|
@@ -257,3 +263,7 @@ You can excecute `gargor` by the daily cron, your servers will be tuned continuo
|
|
257
263
|
5. Create new Pull Request
|
258
264
|
|
259
265
|
|
266
|
+
|
267
|
+
|
268
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/tumf/gargor/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
269
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/bin/gargor
CHANGED
data/gargor.gemspec
CHANGED
@@ -20,4 +20,12 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
22
|
spec.add_development_dependency "rake"
|
23
|
+
|
24
|
+
spec.add_runtime_dependency "json"
|
25
|
+
spec.add_runtime_dependency "jsonpath"
|
26
|
+
spec.add_runtime_dependency "progressbar"
|
27
|
+
spec.add_runtime_dependency "version"
|
28
|
+
spec.add_runtime_dependency "thor"
|
29
|
+
spec.add_runtime_dependency "terminal-table"
|
30
|
+
|
23
31
|
end
|
data/lib/gargor/cli.rb
CHANGED
data/spec/gargor_cli_spec.rb
CHANGED
@@ -4,9 +4,10 @@ require 'gargor/cli'
|
|
4
4
|
describe Gargor::CLI,".start" do
|
5
5
|
it "exits when raise ExterminationError" do
|
6
6
|
to_load_fixture "sample-1.rb"
|
7
|
-
Gargor.
|
7
|
+
allow(Gargor).to receive(:populate) {
|
8
8
|
raise Gargor::ExterminationError
|
9
9
|
}
|
10
10
|
expect{Gargor::CLI.start([])}.to raise_error(SystemExit)
|
11
11
|
end
|
12
12
|
end
|
13
|
+
|
@@ -20,7 +20,7 @@ describe Gargor::Individual, "#deploy" do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "build collect command-line" do
|
23
|
-
@i.
|
23
|
+
allow(@i).to receive(:shell) { |cmd|
|
24
24
|
expect(cmd).to match /knife solo cook (www-1|www-2|db-1).example/
|
25
25
|
["",0]
|
26
26
|
}
|
@@ -28,7 +28,7 @@ describe Gargor::Individual, "#deploy" do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it "raise Gargor::DeployError if deploy failed" do
|
31
|
-
@i.
|
31
|
+
allow(@i).to receive(:shell) { |cmd|
|
32
32
|
["",255]
|
33
33
|
}
|
34
34
|
expect{@i.deploy}.to raise_error Gargor::DeployError
|
@@ -42,7 +42,7 @@ describe Gargor::Individual, "attack" do
|
|
42
42
|
Gargor.start
|
43
43
|
Gargor.load_dsl("dummy")
|
44
44
|
i = Gargor.mutate
|
45
|
-
i.
|
45
|
+
allow(i).to receive(:shell) { |cmd|
|
46
46
|
expect(cmd).to eq Gargor.opt("attack_cmd")
|
47
47
|
out=<<EOF
|
48
48
|
abc, 3300 req/s
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'helper'
|
2
|
+
require 'gargor/reporter'
|
3
|
+
|
4
|
+
describe Gargor::OptimizeReporter, ".table" do
|
5
|
+
before do
|
6
|
+
to_load_fixture "sample-1.rb"
|
7
|
+
Gargor.start
|
8
|
+
Gargor.load_dsl("dummy")
|
9
|
+
@a,@b = Gargor.mutate,Gargor.mutate
|
10
|
+
end
|
11
|
+
|
12
|
+
it "return Terminal::Table object" do
|
13
|
+
expect(Gargor::OptimizeReporter.table(@a,@b)).to be_kind_of Terminal::Table
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
data/spec/gargor_spec.rb
CHANGED
@@ -65,7 +65,7 @@ end
|
|
65
65
|
|
66
66
|
describe Gargor,".float_rand" do
|
67
67
|
it "returns 0...max" do
|
68
|
-
Gargor.
|
68
|
+
allow(Gargor).to receive(:rand) { |max| max/2.0 }
|
69
69
|
expect(Gargor.float_rand(0.1,100)).to eq 0.05
|
70
70
|
end
|
71
71
|
|
@@ -157,7 +157,7 @@ end
|
|
157
157
|
|
158
158
|
describe Gargor, ".mutaion?" do
|
159
159
|
it "returns true by mutation probability" do
|
160
|
-
Gargor.
|
160
|
+
allow(Gargor).to receive(:rand).and_return(0.05,0.15)
|
161
161
|
expect(Gargor.mutation?(0.1)).to be true
|
162
162
|
expect(Gargor.mutation?(0.1)).to be false
|
163
163
|
end
|
data/spec/helper.rb
CHANGED
@@ -22,11 +22,11 @@ def load_fixture name
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def to_load_fixture name
|
25
|
-
File.
|
25
|
+
allow(File).to receive(:read).and_return(load_fixture(name))
|
26
26
|
end
|
27
27
|
|
28
28
|
def to_load_contents text
|
29
|
-
File.
|
29
|
+
allow(File).to receive(:read).and_return(text)
|
30
30
|
end
|
31
31
|
|
32
32
|
|
metadata
CHANGED
@@ -1,41 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gargor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshihiro TAKAHARA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: jsonpath
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: progressbar
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: version
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: thor
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: terminal-table
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
39
123
|
- !ruby/object:Gem::Version
|
40
124
|
version: '0'
|
41
125
|
description: 'An auto-tuning tool for internet servers w/ Genetic Algorithm and Chef.
|
@@ -47,8 +131,8 @@ executables:
|
|
47
131
|
extensions: []
|
48
132
|
extra_rdoc_files: []
|
49
133
|
files:
|
50
|
-
- .gitignore
|
51
|
-
- .travis.yml
|
134
|
+
- ".gitignore"
|
135
|
+
- ".travis.yml"
|
52
136
|
- Gemfile
|
53
137
|
- LICENSE.txt
|
54
138
|
- README.md
|
@@ -71,6 +155,7 @@ files:
|
|
71
155
|
- spec/fixtures/sample-1.rb
|
72
156
|
- spec/gargor_cli_spec.rb
|
73
157
|
- spec/gargor_individual_spec.rb
|
158
|
+
- spec/gargor_reporter_spec.rb
|
74
159
|
- spec/gargor_spec.rb
|
75
160
|
- spec/gargor_version_spec.rb
|
76
161
|
- spec/helper.rb
|
@@ -84,17 +169,17 @@ require_paths:
|
|
84
169
|
- lib
|
85
170
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
171
|
requirements:
|
87
|
-
- -
|
172
|
+
- - ">="
|
88
173
|
- !ruby/object:Gem::Version
|
89
174
|
version: '0'
|
90
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
176
|
requirements:
|
92
|
-
- -
|
177
|
+
- - ">="
|
93
178
|
- !ruby/object:Gem::Version
|
94
179
|
version: '0'
|
95
180
|
requirements: []
|
96
181
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
182
|
+
rubygems_version: 2.4.5
|
98
183
|
signing_key:
|
99
184
|
specification_version: 4
|
100
185
|
summary: It is software which uses generic algorithm to support parameter tuning of
|
@@ -103,6 +188,7 @@ test_files:
|
|
103
188
|
- spec/fixtures/sample-1.rb
|
104
189
|
- spec/gargor_cli_spec.rb
|
105
190
|
- spec/gargor_individual_spec.rb
|
191
|
+
- spec/gargor_reporter_spec.rb
|
106
192
|
- spec/gargor_spec.rb
|
107
193
|
- spec/gargor_version_spec.rb
|
108
194
|
- spec/helper.rb
|