what 0.3.1 → 0.3.2
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 +6 -6
- data/lib/what/helpers.rb +5 -0
- data/lib/what/modules/process.rb +1 -1
- data/lib/what/modules/unicorn.rb +1 -1
- data/lib/what/version.rb +1 -1
- metadata +19 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: a05b44368d427254588c3e03b0849e7956d9f3ba
|
4
|
+
data.tar.gz: 760119d80731c41d91381186fb9c742726b0ddff
|
5
|
+
!binary "U0hBNTEy":
|
6
|
+
metadata.gz: c91b8ec3139dd64e96d37c3eb13377f645e005752ded947a6ef4d191d88809818b24f3148313a80a3890cb3233dbc183797f243e927abe2a5124ae1f4c2dd123
|
7
|
+
data.tar.gz: 9e4312328b0b4bb429024e5e2fd6008ea47a290805d0024e6da8f9263c08c2203db9f4c04d8fbb6c2bb66c7cbc1412f856bb2d00d84d1ace91aa8bb28fd4387a
|
data/lib/what/helpers.rb
CHANGED
@@ -36,5 +36,10 @@ module What
|
|
36
36
|
def self.curl(uri)
|
37
37
|
yield(open(uri).read)
|
38
38
|
end
|
39
|
+
|
40
|
+
# Performs a simple strip of invalid UTF-8 characters on the output of 'ps aux'
|
41
|
+
def self.process_lines
|
42
|
+
`ps aux`.encode('UTF-16', invalid: :replace, undef: :replace).encode('UTF-8').split("\n")
|
43
|
+
end
|
39
44
|
end
|
40
45
|
end
|
data/lib/what/modules/process.rb
CHANGED
@@ -6,7 +6,7 @@ module What
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def check
|
9
|
-
@processes =
|
9
|
+
@processes = Helper.process_lines.grep(@regexp).map do |ln|
|
10
10
|
ln =~ /^\w+\s+(\d+).*(\d+:\d\d(?:\.\d\d)?) (.*)$/
|
11
11
|
{'pid' => $1, 'cpu_time' => $2, 'proctitle' => $3.strip}
|
12
12
|
end
|
data/lib/what/modules/unicorn.rb
CHANGED
@@ -10,7 +10,7 @@ module What
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def check
|
13
|
-
@unicorns =
|
13
|
+
@unicorns = Helper.process_lines.split("\n").grep(/unicorn_rails worker/).map do |ln|
|
14
14
|
ln =~ /^\w+\s+(\d+).*(\d+:\d\d(?:\.\d\d)?) unicorn/
|
15
15
|
{'pid' => $1, 'cpu_time' => $2}
|
16
16
|
end
|
data/lib/what/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: what
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Fitzgerald
|
@@ -10,55 +10,60 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-08-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - '>='
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 1.1.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- - '>='
|
26
|
+
- - ! '>='
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 1.1.2
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: json
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- - '>='
|
33
|
+
- - ! '>='
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- - '>='
|
40
|
+
- - ! '>='
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: celluloid
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - '>='
|
47
|
+
- - ! '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - '>='
|
54
|
+
- - ! '>='
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
|
-
description:
|
58
|
-
|
57
|
+
description: ! 'What uses WEBrick to serve a JSON object representing the state of
|
58
|
+
services
|
59
|
+
|
59
60
|
running on a machine. It currently includes modules for monitoring Unicorn
|
61
|
+
|
60
62
|
workers, checking for the existence of files and processes, and combining
|
63
|
+
|
61
64
|
the output of other What servers.
|
65
|
+
|
66
|
+
'
|
62
67
|
email:
|
63
68
|
- rwfitzge@gmail.com
|
64
69
|
- rpjlower@gmail.com
|
@@ -108,18 +113,19 @@ require_paths:
|
|
108
113
|
- lib
|
109
114
|
required_ruby_version: !ruby/object:Gem::Requirement
|
110
115
|
requirements:
|
111
|
-
- - '>='
|
116
|
+
- - ! '>='
|
112
117
|
- !ruby/object:Gem::Version
|
113
118
|
version: '0'
|
114
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
120
|
requirements:
|
116
|
-
- - '>='
|
121
|
+
- - ! '>='
|
117
122
|
- !ruby/object:Gem::Version
|
118
123
|
version: '0'
|
119
124
|
requirements: []
|
120
125
|
rubyforge_project: what
|
121
|
-
rubygems_version: 2.0.
|
126
|
+
rubygems_version: 2.0.3
|
122
127
|
signing_key:
|
123
128
|
specification_version: 4
|
124
129
|
summary: Simple server monitoring tool
|
125
130
|
test_files: []
|
131
|
+
has_rdoc:
|