worker_killer 0.0.4 → 0.0.9.19836

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: dd68e0bf581f102ddbf11561cbafec2dea05b555f8349d9a86ff24aedf7fa682
4
- data.tar.gz: 6d7df0e370ec8efc7375b727b99df99e806bdcc3bd28bca342d572a10ea3b80b
3
+ metadata.gz: 6afd0ad3285687093b9b10b00153eb82e127939acff50aeb0e34c29380058120
4
+ data.tar.gz: e8ce002079c3caf5681ec11db247bbdd3a4dab124cd06929c28a821a4ae6235d
5
5
  SHA512:
6
- metadata.gz: 459b5cbc8c683dde9bd4ad995b4d61bfc1b82fb76c6b602ef84aec5dc0ba0dff8e0ac92eeac99c9a1cacff3d30e6e48a62da3f68c0235cd5aa67dff4f8aad926
7
- data.tar.gz: 516c7d461f44f2ce30ef8d0d02421a1765d8e8a56f510d6f8f7b691c259e92dd85bc0166cfd15a9512c2de53ece760a418841b14d666020085331cfc97016bd7
6
+ metadata.gz: 482658ddc4984d4571a2b1cf8469e23fed14aab4d6a8fa3131d7d21c07d840b2b89ba121d441163141f6e6ed9a068b3a726ee242e10b9f05da4ce38404ee9e08
7
+ data.tar.gz: 248995d17c2e791a22d7e5af51849f0b421bdfef360c0c961bd346096d6959499a3b92b53b42495c8961291680e79239c45de3fef2f0d19e3618e6e8f98ac92c
@@ -0,0 +1 @@
1
+ require 'worker_killer'
@@ -1,7 +1,8 @@
1
1
  module WorkerKiller
2
2
  class CountLimiter
3
3
 
4
- attr_reader :min, :max, :limit, :started_at
4
+ attr_reader :min, :max, :left, :limit, :started_at
5
+ attr_accessor :reaction
5
6
 
6
7
  def initialize(min: 3072, max: 4096, verbose: false, &block)
7
8
  @min = min
@@ -4,6 +4,7 @@ module WorkerKiller
4
4
  class MemoryLimiter
5
5
 
6
6
  attr_reader :min, :max, :limit, :started_at, :check_cycle
7
+ attr_accessor :reaction
7
8
 
8
9
  def initialize(min: (1024**3), max: (2 * (1024**3)), check_cycle: 16, verbose: false, &block)
9
10
  @min = min
@@ -21,7 +22,7 @@ module WorkerKiller
21
22
  @started_at ||= Time.now
22
23
  @check_count += 1
23
24
 
24
- return false if (@check_count % @check_cycle) != 0
25
+ return nil if (@check_count % @check_cycle) != 0
25
26
 
26
27
  rss = GetProcessMem.new.bytes
27
28
  if @verbose
@@ -4,6 +4,8 @@ require 'worker_killer/count_limiter'
4
4
  module WorkerKiller
5
5
  class Middleware
6
6
 
7
+ attr_reader :limiter
8
+
7
9
  def initialize(app, klass:, reaction: nil, **opts)
8
10
  @app = app
9
11
 
@@ -11,9 +13,7 @@ module WorkerKiller
11
13
  WorkerKiller.kill_self(limiter.logger, limiter.started_at)
12
14
  end
13
15
 
14
- @limiter = klass.new(opts) do |limiter|
15
- reaction.call(limiter)
16
- end
16
+ @limiter = klass.new(opts, &reaction)
17
17
  end
18
18
 
19
19
  def call(env)
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WorkerKiller
4
+ VERSION = '0.0.9'
5
+ end
data/lib/worker_killer.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'worker_killer/version'
1
2
  require 'worker_killer/configuration'
2
3
  require 'worker_killer/count_limiter'
3
4
  require 'worker_killer/memory_limiter'
@@ -36,12 +37,12 @@ module WorkerKiller
36
37
  if configuration.use_quit
37
38
  sig = :QUIT
38
39
  sig = :TERM if @kill_attempts > configuration.quit_attempts
40
+ sig = :KILL if @kill_attempts > (configuration.quit_attempts + configuration.kill_attempts)
39
41
  else
40
42
  sig = :TERM
43
+ sig = :KILL if @kill_attempts > configuration.kill_attempts
41
44
  end
42
45
 
43
- sig = :KILL if @kill_attempts > configuration.kill_attempts
44
-
45
46
  logger.warn "#{self} send SIG#{sig} (pid: #{self_pid}) alive: #{alive_sec} sec (trial #{@kill_attempts})"
46
47
  Process.kill sig, self_pid
47
48
  end
@@ -0,0 +1,32 @@
1
+ RSpec.describe WorkerKiller::CountLimiter do
2
+ let(:logger){ Logger.new(nil) }
3
+
4
+ subject{ described_class.new(options) }
5
+ let(:min){ rand(50..100) }
6
+ let(:max){ min + rand(100) }
7
+ let(:options){ { min: min, max: max } }
8
+
9
+ it { is_expected.to have_attributes(min: min, max: max, limit: a_value_between(min, max), left: subject.limit) }
10
+
11
+ it 'expect not to react while less than limit' do
12
+ expect do |b|
13
+ subject.reaction = b.to_proc
14
+ (subject.limit - 1).times do
15
+ expect(subject.check).to be_falsey
16
+ end
17
+ end.not_to yield_control
18
+ end
19
+
20
+ it 'expect call reaction when check succeded' do
21
+ (subject.limit - 1).times do
22
+ expect(subject.check).to be_falsey
23
+ end
24
+
25
+ expect do |b|
26
+ subject.reaction = b.to_proc
27
+ expect(subject.check).to be_truthy
28
+ expect(subject.check).to be_truthy
29
+ end.to yield_control.exactly(2).times
30
+ end
31
+ end
32
+
@@ -0,0 +1,52 @@
1
+ RSpec.describe WorkerKiller::MemoryLimiter do
2
+ let(:logger){ Logger.new(nil) }
3
+
4
+ subject{ described_class.new(options) }
5
+ let(:mb){ 1024 * 1024 }
6
+ let(:min){ rand(50..100) * mb }
7
+ let(:max){ min + rand(100) * mb }
8
+ let(:check_cycle){ 5 }
9
+ let(:options){ { min: min, max: max, check_cycle: check_cycle } }
10
+
11
+ it { is_expected.to have_attributes(min: min, max: max, limit: a_value_between(min, max)) }
12
+
13
+ def skip_cycles(object, cycles)
14
+ (cycles - 1).times do
15
+ expect(object.check).to be_nil
16
+ end
17
+ end
18
+
19
+ it 'expect to skip check while less than cycle count' do
20
+ expect(GetProcessMem).not_to receive(:new)
21
+
22
+ expect do |b|
23
+ subject.reaction = b.to_proc
24
+ skip_cycles(subject, check_cycle)
25
+ end.not_to yield_control
26
+ end
27
+
28
+ it 'expect to skip check after cycle count reached' do
29
+ memory = instance_double(GetProcessMem)
30
+ expect(memory).to receive(:bytes).and_return(min - 1)
31
+ expect(GetProcessMem).to receive(:new).and_return(memory)
32
+
33
+ expect do |b|
34
+ subject.reaction = b.to_proc
35
+ skip_cycles(subject, check_cycle)
36
+ expect(subject.check).to be_falsey
37
+ end.not_to yield_control
38
+ end
39
+
40
+ it 'expect call reaction when check succeded' do
41
+ memory = instance_double(GetProcessMem)
42
+ expect(memory).to receive(:bytes).and_return(subject.limit + 1)
43
+ expect(GetProcessMem).to receive(:new).and_return(memory)
44
+
45
+ expect do |b|
46
+ subject.reaction = b.to_proc
47
+ skip_cycles(subject, check_cycle)
48
+ expect(subject.check).to be_truthy
49
+ end.to yield_control.exactly(1).times
50
+ end
51
+ end
52
+
@@ -0,0 +1,46 @@
1
+ require 'securerandom'
2
+
3
+ RSpec.describe WorkerKiller::Middleware do
4
+ let(:logger){ Logger.new(nil) }
5
+
6
+ let(:app){ double }
7
+ let(:reaction){ ->{} }
8
+ let(:anykey){ SecureRandom.hex(8) }
9
+
10
+ describe 'Custom class' do
11
+ let(:klass){ double }
12
+ let(:options){ { klass: klass, reaction: reaction, anykey: anykey } }
13
+ subject{ described_class.new(app, options) }
14
+
15
+ it 'is expected to be initialized' do
16
+ expect(klass).to receive(:new).with(anykey: anykey).and_return(99)
17
+ expect(subject.limiter).to eq(99)
18
+ end
19
+ end
20
+
21
+ describe WorkerKiller::Middleware::RequestsLimiter do
22
+ let(:options){ {reaction: reaction, min: 1111 } }
23
+ subject{ described_class.new(app, options) }
24
+
25
+ it 'is expected to be initialized with reaction' do
26
+ expect(WorkerKiller::CountLimiter).to receive(:new).with(min: 1111).and_call_original
27
+ expect(subject.limiter).to be_an(WorkerKiller::CountLimiter)
28
+ expect(subject.limiter.min).to eq(1111)
29
+ expect(subject.limiter.reaction).to eq(reaction)
30
+ end
31
+ end
32
+
33
+ describe WorkerKiller::Middleware::OOMLimiter do
34
+ let(:options){ {reaction: reaction, min: 2222 } }
35
+ subject{ described_class.new(app, options) }
36
+
37
+ it 'is expected to be initialized with reaction' do
38
+ expect(WorkerKiller::MemoryLimiter).to receive(:new).with(min: 2222).and_call_original
39
+ expect(subject.limiter).to be_an(WorkerKiller::MemoryLimiter)
40
+ expect(subject.limiter.min).to eq(2222)
41
+ expect(subject.limiter.reaction).to eq(reaction)
42
+ end
43
+ end
44
+
45
+ end
46
+
@@ -0,0 +1,110 @@
1
+ # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+
20
+ # require 'rspec/retry'
21
+
22
+ require 'simplecov'
23
+ require 'simplecov-console'
24
+
25
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
26
+ SimpleCov::Formatter::HTMLFormatter, # for gitlab
27
+ SimpleCov::Formatter::Console # for developers
28
+ ])
29
+ SimpleCov.start
30
+
31
+ require 'worker_killer'
32
+
33
+ $root = File.join(File.dirname(__dir__), 'spec')
34
+ Dir[File.join(__dir__, 'support', '**', '*.rb')].sort.each {|f| require f }
35
+
36
+ RSpec.configure do |config|
37
+ # config.verbose_retry = true
38
+ # Try twice (retry once)
39
+ # config.default_retry_count = 2
40
+
41
+ # rspec-expectations config goes here. You can use an alternate
42
+ # assertion/expectation library such as wrong or the stdlib/minitest
43
+ # assertions if you prefer.
44
+ config.expect_with :rspec do |expectations|
45
+ # This option will default to `true` in RSpec 4. It makes the `description`
46
+ # and `failure_message` of custom matchers include text for helper methods
47
+ # defined using `chain`, e.g.:
48
+ # be_bigger_than(2).and_smaller_than(4).description
49
+ # # => "be bigger than 2 and smaller than 4"
50
+ # ...rather than:
51
+ # # => "be bigger than 2"
52
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
53
+ end
54
+
55
+ # rspec-mocks config goes here. You can use an alternate test double
56
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
57
+ config.mock_with :rspec do |mocks|
58
+ # Prevents you from mocking or stubbing a method that does not exist on
59
+ # a real object. This is generally recommended, and will default to
60
+ # `true` in RSpec 4.
61
+ mocks.verify_partial_doubles = true
62
+ end
63
+
64
+ # config.filter_run :molot
65
+ config.run_all_when_everything_filtered = true
66
+
67
+ # The settings below are suggested to provide a good initial experience
68
+ # with RSpec, but feel free to customize to your heart's content.
69
+ # # These two settings work together to allow you to limit a spec run
70
+ # # to individual examples or groups you care about by tagging them with
71
+ # # `:focus` metadata. When nothing is tagged with `:focus`, all examples
72
+ # # get run.
73
+ # config.filter_run :focus
74
+ # config.run_all_when_everything_filtered = true
75
+ #
76
+ # # Limits the available syntax to the non-monkey patched syntax that is
77
+ # # recommended. For more details, see:
78
+ # # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
79
+ # # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
80
+ # # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
81
+ # config.disable_monkey_patching!
82
+ #
83
+ # # Many RSpec users commonly either run the entire suite or an individual
84
+ # # file, and it's useful to allow more verbose output when running an
85
+ # # individual spec file.
86
+ # if config.files_to_run.one?
87
+ # # Use the documentation formatter for detailed output,
88
+ # # unless a formatter has already been configured
89
+ # # (e.g. via a command-line flag).
90
+ # config.default_formatter = 'doc'
91
+ # end
92
+ #
93
+ # # Print the 10 slowest examples and example groups at the
94
+ # # end of the spec run, to help surface which specs are running
95
+ # # particularly slow.
96
+ # config.profile_examples = 10
97
+ #
98
+ # # Run specs in random order to surface order dependencies. If you find an
99
+ # # order dependency and want to debug it, you can fix the order by providing
100
+ # # the seed, which is printed after each run.
101
+ # # --seed 1234
102
+ # config.order = :random
103
+ #
104
+ # # Seed global randomization in this process using the `--seed` CLI option.
105
+ # # Setting this allows you to use `--seed` to deterministically reproduce
106
+ # # test failures related to randomization by passing the same `--seed` value
107
+ # # as the one that triggered the failure.
108
+ # Kernel.srand config.seed
109
+ end
110
+
@@ -0,0 +1,66 @@
1
+ RSpec.describe WorkerKiller do
2
+ let(:logger){ Logger.new(nil) }
3
+ let(:config) do
4
+ WorkerKiller::Configuration.new.tap do |c|
5
+ c.quit_attempts = 2
6
+ c.kill_attempts = 2
7
+ end
8
+ end
9
+
10
+ before do
11
+ WorkerKiller.instance_variable_set('@kill_attempts', nil)
12
+ end
13
+
14
+ describe '#randomize' do
15
+ [1, 5, 25, 125, 5000, 10_000].each do |max|
16
+ it "randomize(#{max})" do
17
+ 1000.times do
18
+ rnd = WorkerKiller.randomize(max)
19
+ expect(rnd).to be >= 0
20
+ expect(rnd).to be < max
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ describe '#kill_self' do
27
+ context 'with use_quit TRUE' do
28
+ around do |example|
29
+ prev = WorkerKiller.configuration
30
+ config.use_quit = true
31
+ WorkerKiller.configuration = config
32
+ example.run
33
+ ensure
34
+ WorkerKiller.configuration = prev
35
+ end
36
+
37
+ it 'expect right signal order' do
38
+ expect(Process).to receive(:kill).with(:QUIT, anything).exactly(2).times
39
+ expect(Process).to receive(:kill).with(:TERM, anything).exactly(2).times
40
+ expect(Process).to receive(:kill).with(:KILL, anything).exactly(5).times
41
+ 2.times { WorkerKiller.kill_self(logger, Time.now) } # 2 QUIT
42
+ 2.times { WorkerKiller.kill_self(logger, Time.now) } # 2 TERM
43
+ 5.times { WorkerKiller.kill_self(logger, Time.now) } # other - KILL
44
+ end
45
+ end
46
+
47
+ context 'with use_quit FALSE' do
48
+ around do |example|
49
+ prev = WorkerKiller.configuration
50
+ config.use_quit = false
51
+ WorkerKiller.configuration = config
52
+ example.run
53
+ ensure
54
+ WorkerKiller.configuration = prev
55
+ end
56
+
57
+ it 'expect right signal order' do
58
+ expect(Process).to receive(:kill).with(:TERM, anything).exactly(2).times
59
+ expect(Process).to receive(:kill).with(:KILL, anything).exactly(5).times
60
+ 2.times { WorkerKiller.kill_self(logger, Time.now) } # 2 TERM
61
+ 5.times { WorkerKiller.kill_self(logger, Time.now) } # other - KILL
62
+ end
63
+ end
64
+ end
65
+ end
66
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worker_killer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.9.19836
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoilenko Yuri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-27 00:00:00.000000000 Z
11
+ date: 2019-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: get_process_mem
@@ -24,6 +24,40 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 2.0.1
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '2.0'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 2.0.1
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
27
61
  - !ruby/object:Gem::Dependency
28
62
  name: rspec
29
63
  requirement: !ruby/object:Gem::Requirement
@@ -87,21 +121,20 @@ executables: []
87
121
  extensions: []
88
122
  extra_rdoc_files: []
89
123
  files:
90
- - ".dockerignore"
91
- - ".gitignore"
92
- - ".rubocop.yml"
93
124
  - AUTHORS
94
- - ChangeLog
95
- - Gemfile
96
- - LICENSE
97
125
  - README.md
98
- - VERSION
126
+ - lib/worker-killer.rb
99
127
  - lib/worker_killer.rb
100
128
  - lib/worker_killer/configuration.rb
101
129
  - lib/worker_killer/count_limiter.rb
102
130
  - lib/worker_killer/memory_limiter.rb
103
131
  - lib/worker_killer/middleware.rb
104
- - worker_killer.gemspec
132
+ - lib/worker_killer/version.rb
133
+ - spec/count_limiter_spec.rb
134
+ - spec/memory_limiter_spec.rb
135
+ - spec/middleware_spec.rb
136
+ - spec/spec_helper.rb
137
+ - spec/worker_killer_spec.rb
105
138
  homepage: https://github.com/RnD-Soft/worker_killer
106
139
  licenses:
107
140
  - MIT
@@ -121,8 +154,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
154
  - !ruby/object:Gem::Version
122
155
  version: '0'
123
156
  requirements: []
124
- rubygems_version: 3.0.6
157
+ rubygems_version: 3.0.3
125
158
  signing_key:
126
159
  specification_version: 4
127
160
  summary: Kill any workers by memory and request counts or take custom reaction
128
- test_files: []
161
+ test_files:
162
+ - spec/middleware_spec.rb
163
+ - spec/spec_helper.rb
164
+ - spec/memory_limiter_spec.rb
165
+ - spec/worker_killer_spec.rb
166
+ - spec/count_limiter_spec.rb
data/.dockerignore DELETED
@@ -1,20 +0,0 @@
1
- *.gem
2
- log/*
3
- tmp/*
4
- doc/*
5
- envs/*
6
- coverage/*
7
- Dockerfile*
8
- docker-compose*
9
- /node_modules
10
- config/keys/*
11
- config/database.yml
12
- config/secrets.yml
13
- vendor/cache
14
- rspec*
15
-
16
- .gitignore
17
- .gitlab-ci.yml
18
-
19
-
20
-
data/.gitignore DELETED
@@ -1,124 +0,0 @@
1
- #----------------------------------------------------------------------------
2
- # Ignore these files when commiting to a git repository.
3
- #
4
- # See http://help.github.com/ignore-files/ for more about ignoring files.
5
- #
6
- # The original version of this file is found here:
7
- # https://github.com/RailsApps/rails-composer/blob/master/files/gitignore.txt
8
- #
9
- # Corrections? Improvements? Create a GitHub issue:
10
- # http://github.com/RailsApps/rails-composer/issues
11
- #----------------------------------------------------------------------------
12
-
13
- # bundler state
14
- /.bundle
15
- /vendor/bundle/
16
- /vendor/ruby/
17
- vendor/cache
18
-
19
- # minimal Rails specific artifacts
20
- db/*.sqlite3
21
- db/schema.rb
22
- /db/*.sqlite3-journal
23
- /log/*
24
- /tmp/*
25
- /swagger/*
26
-
27
-
28
- # add /config/database.yml if it contains passwords
29
- # /config/database.yml
30
-
31
- # various artifacts
32
- **.war
33
- *.rbc
34
- *.sassc
35
- .redcar/
36
- .sass-cache
37
- /config/config.yml
38
- /coverage.data
39
- /coverage/
40
- /db/*.javadb/
41
- /db/*.sqlite3
42
- config/database.yml
43
- config/secrets.yml
44
- config/app.yml
45
- config/cable.yml
46
- config/bunny.yml
47
- oxymoron.js
48
- /doc/api/
49
- /doc/app/
50
- /doc/features.html
51
- /doc/specs.html
52
- /public/cache
53
- /public/uploads
54
- /public/stylesheets/compiled
55
- /public/system/*
56
- /spec/tmp/*
57
- /cache
58
- /capybara*
59
- /capybara-*.html
60
- /gems
61
- /specifications
62
- rerun.txt
63
- pickle-email-*.html
64
- *.sublime-project
65
- *.sublime-workspace
66
- .zeus.sock
67
- .byebug_history
68
-
69
- #test
70
- /docs
71
-
72
-
73
- # If you find yourself ignoring temporary files generated by your text editor
74
- # or operating system, you probably want to add a global ignore instead:
75
- # git config --global core.excludesfile ~/.gitignore_global
76
- #
77
- # Here are some files you may want to ignore globally:
78
-
79
- # scm revert files
80
- **.orig
81
-
82
- # Mac finder artifacts
83
- .DS_Store
84
-
85
- # Netbeans project directory
86
- /nbproject/
87
-
88
- # RubyMine project files
89
- .idea
90
-
91
- # VsCode project files
92
- .vscode
93
- *.code-workspace
94
-
95
- # Textmate project files
96
- /*.tmproj
97
-
98
- # vim artifacts
99
- **.swp
100
-
101
- # Environment files that may contain sensitive data
102
- .powenv
103
-
104
- # tilde files are usually backup files from a text editor
105
- *~
106
- public/assets/
107
- config/keys
108
- public/.revision
109
- storage/*
110
- spec/reports/
111
-
112
- erd-schema.*
113
- .ruby-gemset
114
- .ruby-version
115
- passenger.*.pid.lock
116
- *.sublime-project
117
- *.sublime-workspace
118
-
119
- /public/packs
120
- /public/packs-test
121
- /node_modules
122
- /yarn-error.log
123
- yarn-debug.log*
124
- .yarn-integrity
data/.rubocop.yml DELETED
@@ -1,133 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.5
3
- Exclude:
4
- - "storage/**/*"
5
-
6
- Layout/TrailingBlankLines:
7
- Enabled: true
8
- AutoCorrect: true
9
- EnforcedStyle: final_blank_line
10
-
11
- #Layout/IndentationWidth:
12
- # Enabled: true
13
-
14
- #Layout/IndentAssignment:
15
- # Enabled: false
16
- # IndentationWidth: false
17
-
18
- #Layout/ElseAlignment:
19
- # Enabled: false
20
-
21
- Layout/MultilineOperationIndentation:
22
- EnforcedStyle: indented
23
-
24
- Layout/MultilineAssignmentLayout:
25
- EnforcedStyle: new_line
26
-
27
- Layout/RescueEnsureAlignment:
28
- Enabled: true
29
-
30
- Layout/EndAlignment:
31
- Enabled: true
32
- EnforcedStyleAlignWith: variable
33
- AutoCorrect: true
34
-
35
- Layout/AlignHash:
36
- EnforcedColonStyle: table
37
- EnforcedHashRocketStyle: table
38
-
39
- Layout/IndentationConsistency:
40
- EnforcedStyle: indented_internal_methods
41
-
42
- Layout/EmptyLines:
43
- Enabled: false
44
-
45
- Layout/EmptyLinesAroundClassBody:
46
- EnforcedStyle: empty_lines_except_namespace
47
-
48
- Layout/EmptyLinesAroundModuleBody:
49
- EnforcedStyle: empty_lines_except_namespace
50
-
51
- Layout/SpaceInsideBlockBraces:
52
- EnforcedStyle: space
53
- SpaceBeforeBlockParameters: false
54
-
55
- Layout/SpaceAroundBlockParameters:
56
- EnforcedStyleInsidePipes: no_space
57
-
58
- Layout/SpaceBeforeBlockBraces:
59
- Enabled: false
60
-
61
- #Lint/AssignmentInCondition:
62
- # Enabled: false
63
-
64
- Metrics/BlockLength:
65
- Exclude:
66
- - "spec/**/*.rb"
67
-
68
- Metrics/LineLength:
69
- Max: 100
70
- IgnoredPatterns: ['(\A|\s)#']
71
-
72
- Metrics/AbcSize:
73
- Max: 20
74
-
75
- Metrics/MethodLength:
76
- Max: 20
77
-
78
- Security/YAMLLoad:
79
- Enabled: false
80
-
81
- Style/AsciiComments:
82
- Enabled: false
83
-
84
- Style/RedundantBegin:
85
- Enabled: false
86
-
87
- Style/GlobalVars:
88
- AllowedVariables: ["$logger", "$root"]
89
-
90
- Style/ClassAndModuleChildren:
91
- EnforcedStyle: compact
92
- Enabled: false
93
-
94
- Style/Documentation:
95
- Enabled: false
96
-
97
- Style/Lambda:
98
- Enabled: false
99
-
100
- Style/RedundantSelf:
101
- Enabled: false
102
-
103
- Style/RaiseArgs:
104
- EnforcedStyle: compact
105
-
106
- Style/SpecialGlobalVars:
107
- Enabled: false
108
-
109
- Style/BracesAroundHashParameters:
110
- EnforcedStyle: context_dependent
111
-
112
- Style/NumericPredicate:
113
- Enabled: false
114
-
115
- Style/FrozenStringLiteralComment:
116
- Enabled: false
117
-
118
- Style/DoubleNegation:
119
- Enabled: false
120
-
121
- Style/SymbolArray:
122
- Enabled: false
123
-
124
- Style/RescueModifier:
125
- Enabled: false
126
-
127
- Style/TrailingCommaInArrayLiteral:
128
- Enabled: true
129
- AutoCorrect: true
130
-
131
- Style/TrailingCommaInArguments:
132
- Enabled: true
133
- AutoCorrect: true
data/ChangeLog DELETED
File without changes
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
data/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2014-2019 Рнд Софт
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- SOFTWARE.
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.4
@@ -1,24 +0,0 @@
1
- $:.push File.expand_path('lib', __dir__)
2
-
3
- Gem::Specification.new do |gem|
4
- gem.name = 'worker_killer'
5
- gem.description = 'Kill any workers by memory and request counts or take custom reaction'
6
- gem.homepage = 'https://github.com/RnD-Soft/worker_killer'
7
- gem.summary = gem.description
8
- gem.version = File.read('VERSION').strip
9
- gem.authors = ['Samoilenko Yuri']
10
- gem.email = ['kinnalru@gmail.com']
11
- gem.files = `git ls-files`.split("\n")
12
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
13
- gem.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f) }
14
- gem.license = 'MIT'
15
- gem.require_paths = ['lib']
16
-
17
- gem.add_dependency 'get_process_mem'
18
-
19
- gem.add_development_dependency 'rspec'
20
- gem.add_development_dependency 'rspec_junit_formatter'
21
- gem.add_development_dependency 'simplecov'
22
- gem.add_development_dependency 'simplecov-console'
23
- end
24
-