zombie_passenger_killer 0.2.3 → 0.2.4

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/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ rvm:
2
+ - ree
3
+ - 1.9.2
4
+ - 1.9.3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zombie_passenger_killer (0.2.3)
4
+ zombie_passenger_killer (0.2.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/Readme.md CHANGED
@@ -65,4 +65,6 @@ Author
65
65
 
66
66
  [Michael Grosser](http://grosser.it)<br/>
67
67
  michael@grosser.it<br/>
68
- Hereby placed under public domain, do what you want, just do not hold me accountable...
68
+ License: MIT<br/>
69
+ [![Build Status](https://secure.travis-ci.org/grosser/zombie_passenger_killer.png)](http://travis-ci.org/grosser/zombie_passenger_killer)
70
+
@@ -52,7 +52,7 @@ module ZombiePassengerKiller
52
52
  high_load = if @max_high_cpu
53
53
  store_current_cpu active_processes_in_processlist
54
54
  active_pids_in_passenger_status.select do |pid|
55
- @history[pid].count{|x| x > @high_cpu } >= @max_high_cpu
55
+ (@history[pid] || []).count{|x| x > @high_cpu } >= @max_high_cpu
56
56
  end
57
57
  else
58
58
  []
@@ -1,3 +1,3 @@
1
1
  module ZombiePassengerKiller
2
- Version = VERSION = '0.2.3'
2
+ Version = VERSION = '0.2.4'
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,2 +1 @@
1
- $LOAD_PATH.unshift 'lib'
2
- require 'zombie_passenger_killer'
1
+ require 'zombie_passenger_killer'
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require 'spec_helper'
2
2
 
3
3
  describe ZombiePassengerKiller do
4
4
  let(:killer){
@@ -30,6 +30,14 @@ describe ZombiePassengerKiller do
30
30
  killer.hunt_zombies
31
31
  end
32
32
 
33
+ it "does not blow up when there are more processes in pids then status" do
34
+ @options = {:max => 1}
35
+ killer.stub!(:passenger_pids).and_return([123])
36
+ killer.stub!(:process_status).and_return([{:pid => 124, :cpu => 0}])
37
+ killer.should_receive(:kill_zombie).with(124)
38
+ killer.hunt_zombies
39
+ end
40
+
33
41
  it "kills zombies with high cpu over max" do
34
42
  @options = {:max => 1}
35
43
  killer.stub!(:process_status).and_return([{:pid => 111, :cpu => 100}])
metadata CHANGED
@@ -1,32 +1,24 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: zombie_passenger_killer
3
- version: !ruby/object:Gem::Version
4
- hash: 17
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.4
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 3
10
- version: 0.2.3
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Michael Grosser
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-03-18 00:00:00 Z
12
+ date: 2012-10-18 00:00:00.000000000 Z
19
13
  dependencies: []
20
-
21
14
  description:
22
15
  email: michael@grosser.it
23
- executables:
16
+ executables:
24
17
  - zombie_passenger_killer
25
18
  extensions: []
26
-
27
19
  extra_rdoc_files: []
28
-
29
- files:
20
+ files:
21
+ - .travis.yml
30
22
  - Gemfile
31
23
  - Gemfile.lock
32
24
  - Rakefile
@@ -39,37 +31,34 @@ files:
39
31
  - spec/zombie_passenger_killer_spec.rb
40
32
  - zombie_passenger_killer.gemspec
41
33
  homepage: http://github.com/grosser/zombie_passenger_killer
42
- licenses:
34
+ licenses:
43
35
  - MIT
44
36
  post_install_message:
45
37
  rdoc_options: []
46
-
47
- require_paths:
38
+ require_paths:
48
39
  - lib
49
- required_ruby_version: !ruby/object:Gem::Requirement
40
+ required_ruby_version: !ruby/object:Gem::Requirement
50
41
  none: false
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- hash: 3
55
- segments:
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ segments:
56
47
  - 0
57
- version: "0"
58
- required_rubygems_version: !ruby/object:Gem::Requirement
48
+ hash: -4207878518223099064
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
50
  none: false
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- hash: 3
64
- segments:
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ segments:
65
56
  - 0
66
- version: "0"
57
+ hash: -4207878518223099064
67
58
  requirements: []
68
-
69
59
  rubyforge_project:
70
- rubygems_version: 1.8.15
60
+ rubygems_version: 1.8.24
71
61
  signing_key:
72
62
  specification_version: 3
73
63
  summary: Guaranteed zombie passengers death
74
64
  test_files: []
75
-