public
Rubygem
Description: iPhone friendly web UI for God
Homepage: http://github.com/jnewland/god_web
Clone URL: git://github.com/jnewland/god_web.git
update docs
jnewland (author)
Mon May 19 06:40:52 -0700 2008
commit  8f46bd190e84723a295d994fdb24db28f6ebad13
tree    5b7261b34d7f0bec8aa5c7c8fcf45c5b1b715b06
parent  c9cb962bcba500f91bfae240db3d78c03f4799e5
...
9
10
11
12
 
 
 
 
 
 
 
 
13
14
15
...
29
30
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
33
34
...
9
10
11
 
12
13
14
15
16
17
18
19
20
21
22
...
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
0
@@ -9,7 +9,14 @@ h2. Requirements
0
 
0
 h2. Install
0
 
0
-@sudo gem install jnewland-god_web -s http://gems.github.com@
0
+<code>
0
+<pre>
0
+git clone git://github.com/jnewland/god_web.git
0
+cd god_web
0
+gem build god_web.gemspec
0
+sudo gem install -l god_web-*.gem
0
+</pre>
0
+</code>
0
 
0
 h2. Usage
0
 
0
@@ -29,6 +36,50 @@ Then provide that yaml file as the first argument to god_web:
0
 
0
 @sudo god_web /path/to/god_web.yml -p PORT_TO_RUN_ON -e production@
0
 
0
+You might want to monitor god_web to make sure it stays up:
0
+
0
+<code>
0
+<pre>
0
+God.watch do |w|
0
+  w.name              = "god_web"
0
+  w.interval          = 1.minute
0
+  w.start             = "sudo god_web -e prodction -p 8888"
0
+  w.start_grace       = 10.seconds
0
+  w.restart_grace     = 10.seconds
0
+
0
+  w.start_if do |start|
0
+    start.condition(:process_running) do |c|
0
+      c.running = false
0
+    end
0
+  end
0
+
0
+  w.restart_if do |restart|
0
+    restart.condition(:memory_usage) do |c|
0
+      c.above = 20.megabytes
0
+      c.times = [3, 5]
0
+    end
0
+
0
+    restart.condition(:cpu_usage) do |c|
0
+      c.above = 25.percent
0
+      c.times = 5
0
+    end
0
+  end
0
+
0
+  w.lifecycle do |on|
0
+    on.condition(:flapping) do |c|
0
+      c.to_state = [:start, :restart]
0
+      c.times = 5
0
+      c.within = 5.minute
0
+      c.transition = :unmonitored
0
+      c.retry_in = 10.minutes
0
+      c.retry_times = 5
0
+      c.retry_within = 2.hours
0
+    end
0
+  end
0
+end
0
+</pre>
0
+</code>
0
+
0
 h3. Author
0
 
0
 "Jesse Newland":http://jnewland.com/

Comments