phantom-manager 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/config/config.yml +3 -0
- data/lib/phantom/collector.rb +1 -1
- data/lib/phantom/manager/version.rb +1 -1
- data/lib/phantom/process.rb +1 -1
- data/spec/files/config.yml +1 -0
- data/spec/files/nginx.conf +2 -0
- data/spec/lib/phantom/collector_spec.rb +2 -2
- data/spec/lib/phantom/process_spec.rb +2 -2
- data/spec/shared_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjhjNjU4MzRjMTAyYzIxZTQyODFlMzgyNWU5NmZiZmEyYWM1YzE4Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWQwOTQyMjZlODgzNzlmNDBjZDljZmQ5Mjc3MmI1N2IxNWQ4OTRiOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTFkNDhkMDdkNDU5ZTJiZWEwMjFmOTk5OGFkNGQzZGMyNmEzYjMxNDFhZDVl
|
10
|
+
ZGQzNTAwN2I5Y2JlZmI5YmQ3ZTZiYWU0MzkzNjgwNWQ2MGRhNGRkMGRjZjFl
|
11
|
+
MzRhNGQxYjM3ODVkZjRhZmNmNjdmMmE2MjVlNDM0ZjA4M2I0ZTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MThiYzY4YmFjOTdkZjI5M2FkZmYwYmNlYTc1Yjc3NWNhZTBhNWIyY2U1ZDli
|
14
|
+
NzVhMjJiZWNhMDhiYTliNmYxNGViYzQwMzNlODlmMDdkODUyMzFlM2E0ZGU4
|
15
|
+
ODk5ZDQ3ZmQwNmU2NTMxN2M3MmNiZWM5ODZiZDY4MDhkMzA4YjI=
|
data/Gemfile.lock
CHANGED
data/config/config.yml
CHANGED
data/lib/phantom/collector.rb
CHANGED
@@ -35,7 +35,7 @@ module Phantom
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def running_phantoms_shell_command
|
38
|
-
"ps -e -www -o pid,rss,command | grep '
|
38
|
+
"ps -e -www -o pid,rss,command | grep '#{Cfg.phantom_command}' | grep -v sh | grep -v grep"
|
39
39
|
end
|
40
40
|
|
41
41
|
def log_error(processes, lines)
|
data/lib/phantom/process.rb
CHANGED
data/spec/files/config.yml
CHANGED
data/spec/files/nginx.conf
CHANGED
@@ -57,8 +57,8 @@ module Phantom
|
|
57
57
|
describe "bad processes" do
|
58
58
|
before do
|
59
59
|
phantoms = [
|
60
|
-
{pid: 5555, memory_usage: 1000, command: "
|
61
|
-
{pid: 6666, memory_usage: 1000, command: "
|
60
|
+
{pid: 5555, memory_usage: 1000, command: "#{Cfg.phantom_command} 8020"},
|
61
|
+
{pid: 6666, memory_usage: 1000, command: "#{Cfg.phantom_command} 8003"}
|
62
62
|
]
|
63
63
|
ps = phantoms_ps_shell_output(phantoms)
|
64
64
|
subject.stub(:running_phantoms_shell_output).and_return(ps)
|
@@ -14,10 +14,10 @@ module Phantom
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should initialize with string" do
|
17
|
-
p = Phantom::Process.from_string("1 2
|
17
|
+
p = Phantom::Process.from_string("1 2 #{Cfg.phantom_command} 4")
|
18
18
|
p.pid.should eq 1
|
19
19
|
p.memory_usage.should eq 2
|
20
|
-
p.command.should eq "
|
20
|
+
p.command.should eq "#{Cfg.phantom_command} 4"
|
21
21
|
p.port.should eq 4
|
22
22
|
end
|
23
23
|
|
data/spec/shared_spec.rb
CHANGED
@@ -10,7 +10,7 @@ def generate_memory
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def generate_process
|
13
|
-
Phantom::Process.new(rand(1000), generate_memory, "
|
13
|
+
Phantom::Process.new(rand(1000), generate_memory, "#{Cfg.phantom_command} #{rand(2000)}", 8000 + rand(10))
|
14
14
|
end
|
15
15
|
|
16
16
|
def phantoms_data
|
@@ -18,19 +18,19 @@ def phantoms_data
|
|
18
18
|
{
|
19
19
|
pid: 1000,
|
20
20
|
memory_usage: 100000,
|
21
|
-
command: "
|
21
|
+
command: "#{Cfg.phantom_command} 8002",
|
22
22
|
port: 8002
|
23
23
|
},
|
24
24
|
{
|
25
25
|
pid: 2000,
|
26
26
|
memory_usage: 130000,
|
27
|
-
command: "
|
27
|
+
command: "#{Cfg.phantom_command} 8003",
|
28
28
|
port: 8003
|
29
29
|
},
|
30
30
|
{
|
31
31
|
pid: 3000,
|
32
32
|
memory_usage: 80000,
|
33
|
-
command: "
|
33
|
+
command: "#{Cfg.phantom_command} 8006",
|
34
34
|
port: 8006
|
35
35
|
}
|
36
36
|
]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phantom-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erez Rabih
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|