phantom-manager 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWRkOTFmOTU5OGE0MjU3MTExNWMyM2E2OTdjMjFkZGFlNWMwZjhjMQ==
4
+ NjhjNjU4MzRjMTAyYzIxZTQyODFlMzgyNWU5NmZiZmEyYWM1YzE4Ng==
5
5
  data.tar.gz: !binary |-
6
- ZGQ1ODc5YzBiNzZiNWM4ZmNkMTljOGU2MWVmMWU2YmFkMzc2NzAyYg==
6
+ MWQwOTQyMjZlODgzNzlmNDBjZDljZmQ5Mjc3MmI1N2IxNWQ4OTRiOA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ODEwZGQ3MWM3NTEyZWFlNjM3MTM5OTkwMWUxODY0ZjZiMjk1Mjg5OTAyM2Q4
10
- OWU0NjljNzBkMTEwNGVjMWQzOGFiMWQ3NjkxNWYwMzlhNjBiMjA2YTMxODZl
11
- MWMxMWE1NWEyODliNGU5MzdmYTY3YmUwNTZjZTJlZGNlNWUyYjk=
9
+ MTFkNDhkMDdkNDU5ZTJiZWEwMjFmOTk5OGFkNGQzZGMyNmEzYjMxNDFhZDVl
10
+ ZGQzNTAwN2I5Y2JlZmI5YmQ3ZTZiYWU0MzkzNjgwNWQ2MGRhNGRkMGRjZjFl
11
+ MzRhNGQxYjM3ODVkZjRhZmNmNjdmMmE2MjVlNDM0ZjA4M2I0ZTU=
12
12
  data.tar.gz: !binary |-
13
- YTBmMjdlMThhMDA4NGJmNjlmNDM4ZjJhMjNhYmUxYzY5M2U2MDM5YTM2NTNm
14
- N2U1MWZmN2E0NGIyYzMxOWM3YWM3YWJmZTdhN2E3MTcyZGQyODI5NTg5NzIy
15
- OWNlNGZmZThiNmVmZThhNzFhZDU2MTdlZWI3YmM4NzhkZmU4NTE=
13
+ MThiYzY4YmFjOTdkZjI5M2FkZmYwYmNlYTc1Yjc3NWNhZTBhNWIyY2U1ZDli
14
+ NzVhMjJiZWNhMDhiYTliNmYxNGViYzQwMzNlODlmMDdkODUyMzFlM2E0ZGU4
15
+ ODk5ZDQ3ZmQwNmU2NTMxN2M3MmNiZWM5ODZiZDY4MDhkMzA4YjI=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- phantom-manager (0.0.3)
4
+ phantom-manager (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/config/config.yml CHANGED
@@ -25,3 +25,6 @@ development:
25
25
  phantom_processes_number: 10
26
26
  processes_check_retries: 3
27
27
  processes_check_interval: 15
28
+
29
+ #Command to issue when launching phantomjs
30
+ phantom_command: 'phantomjs rndrme.js'
@@ -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 'phantomjs rndrme.js' | grep -v sh | grep -v 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)
@@ -1,5 +1,5 @@
1
1
  module Phantom
2
2
  module Manager
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -54,7 +54,7 @@ module Phantom
54
54
  private
55
55
 
56
56
  def start_command
57
- "cd #{Cfg.rails_root} && phantomjs rndrme.js #{port} >>#{Cfg.phantom_log_path} 2>&1 &"
57
+ "cd #{Cfg.rails_root} && #{Cfg.phantom_command} #{port} >>#{Cfg.phantom_log_path} 2>&1 &"
58
58
  end
59
59
 
60
60
  end
@@ -10,3 +10,4 @@ test:
10
10
  memory_check_interval: 5
11
11
  processes_check_retries: 3
12
12
  processes_check_interval: 15
13
+ phantom_command: 'phantomjs config/phantomjs/rndrme.js'
@@ -3,7 +3,9 @@ upstream unicorn {
3
3
  }
4
4
 
5
5
  upstream phantomjs {
6
+ server 127.0.0.1:8020 fail_timeout=0; # 2013-08-01 16:06:02 +0300
6
7
  server 127.0.0.1:8002;
8
+ server 127.0.0.1:8003;
7
9
  server 127.0.0.1:8004;
8
10
  server 127.0.0.1:8005;
9
11
  server 127.0.0.1:8006;
@@ -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: "phantomjs rndrme.js 8020"},
61
- {pid: 6666, memory_usage: 1000, command: "phantomjs rndrme.js 8003"}
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 phantomjs rndrme.js 4")
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 "phantomjs rndrme.js 4"
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, "phantomjs rndrme.js #{rand(2000)}", 8000 + rand(10))
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: "phantomjs rndrme.js 8002",
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: "phantomjs rndrme.js 8003",
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: "phantomjs rndrme.js 8006",
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.5
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-07-30 00:00:00.000000000 Z
11
+ date: 2013-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler