god 0.7.6 → 0.7.7
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/History.txt +4 -0
- data/Rakefile +1 -1
- data/lib/god.rb +1 -1
- data/lib/god/system/process.rb +1 -1
- data/lib/god/system/slash_proc_poller.rb +16 -2
- metadata +2 -2
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/lib/god.rb
CHANGED
data/lib/god/system/process.rb
CHANGED
@@ -5,11 +5,25 @@ module God
|
|
5
5
|
@@hertz = 100
|
6
6
|
@@total_mem = nil
|
7
7
|
|
8
|
+
MeminfoPath = '/proc/meminfo'
|
9
|
+
UptimePath = '/proc/uptime'
|
10
|
+
|
11
|
+
RequiredPaths = [MeminfoPath, UptimePath]
|
12
|
+
|
13
|
+
# FreeBSD has /proc by default, but nothing mounted there!
|
14
|
+
# So we should check for the actual required paths!
|
15
|
+
# Returns true if +RequiredPaths+ are readable.
|
16
|
+
def self.usable?
|
17
|
+
RequiredPaths.all? do |path|
|
18
|
+
test(?r, path)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
8
22
|
def initialize(pid)
|
9
23
|
super(pid)
|
10
24
|
|
11
25
|
unless @@total_mem # in K
|
12
|
-
File.open(
|
26
|
+
File.open(MeminfoPath) do |f|
|
13
27
|
@@total_mem = f.gets.split[1]
|
14
28
|
end
|
15
29
|
end
|
@@ -39,7 +53,7 @@ module God
|
|
39
53
|
|
40
54
|
# in seconds
|
41
55
|
def uptime
|
42
|
-
File.read(
|
56
|
+
File.read(UptimePath).split[0].to_f
|
43
57
|
end
|
44
58
|
|
45
59
|
def stat
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: god
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.7.
|
7
|
-
date: 2008-
|
6
|
+
version: 0.7.7
|
7
|
+
date: 2008-06-17 00:00:00 -07:00
|
8
8
|
summary: Like monit, only awesome
|
9
9
|
require_paths:
|
10
10
|
- lib
|