snipr 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +19 -6
- data/lib/snipr/process_locator.rb +1 -2
- data/lib/snipr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 260ebc0fbd826bfa24bd623f4ea8d77814d6f8ad
|
4
|
-
data.tar.gz: 3111be0b3d14412b2edff70811e9e517bd9ea237
|
5
2
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa11945d45829fb5f7ef8d2bfc641109d18d6f238b233c16b1fa2a5e13e1a595164cf1933db78583e90d925b471b09662fab1b19bb63a74e6859a711310e3cd1
|
4
|
+
data.tar.gz: de1f5f425b757abd09630cc232a417db1ade1c8506042a41a7939e15ecd650789fabb827d7ccf4c3dba3ef2f7dfd280224ab0643ca02476b531dca8b6e29ff81
|
5
|
+
SHA1:
|
6
|
+
metadata.gz: a133c18251342f631b0a254bce7546f26ff97e80
|
7
|
+
data.tar.gz: 48a55cc801d8f376bdb0cc7302eea605153e5a90
|
data/README.md
CHANGED
@@ -24,17 +24,30 @@ Or install it yourself as:
|
|
24
24
|
```
|
25
25
|
Usage: reap_resque_workers [options]
|
26
26
|
|
27
|
-
Can be used to reap runaway resque workers that have exceeded too much memory
|
28
|
-
By default, this sends USR1 to the parent worker
|
29
|
-
|
27
|
+
Can be used to reap runaway resque workers that have exceeded too much memory
|
28
|
+
use, CPU use, or time alive. By default, this sends USR1 to the parent worker
|
29
|
+
process, which causes it to immediately kill the runaway child. The parent
|
30
|
+
will then spawn another child to continue work.
|
30
31
|
|
31
32
|
Options:
|
32
|
-
-m, --memory [BYTES] Workers using more than some bytes size of
|
33
|
+
-m, --memory [BYTES] Workers using more than some bytes size of
|
34
|
+
memory
|
33
35
|
-c, --cpu [PERCENTAGE] workers using more than a percentage of CPU
|
34
|
-
-a, --alive [SECONDS] Workers that have been alive for some
|
35
|
-
|
36
|
+
-a, --alive [SECONDS] Workers that have been alive for some
|
37
|
+
length of time in seconds
|
38
|
+
-s, --signal [SIGNAL] Signal to send to the worker's parent.
|
39
|
+
Defaults to USR1.
|
40
|
+
-d, --dry-run Perform a dry run which will identify
|
41
|
+
workers to be reaped but not send any
|
42
|
+
signals
|
36
43
|
```
|
37
44
|
|
45
|
+
#### TODO
|
46
|
+
* Better readme docs
|
47
|
+
* General purpose command that lets you specify process filter options & signal
|
48
|
+
to send to arbitrary processes
|
49
|
+
* A command that targets bloated unicorn workers
|
50
|
+
|
38
51
|
## Contributing
|
39
52
|
|
40
53
|
1. Fork it ( https://github.com/[my-github-username]/snipr/fork )
|
@@ -14,7 +14,6 @@ module Snipr
|
|
14
14
|
MINUTE_SECONDS = 60
|
15
15
|
|
16
16
|
|
17
|
-
attr_accessor :signal
|
18
17
|
attr_reader :includes, :excludes, :filters
|
19
18
|
|
20
19
|
def initialize
|
@@ -99,7 +98,7 @@ module Snipr
|
|
99
98
|
end
|
100
99
|
|
101
100
|
def all_processes
|
102
|
-
Snipr.exec_cmd('ps h -eo pid,ppid
|
101
|
+
Snipr.exec_cmd('ps h -eo pid,ppid,%mem,%cpu,etime,command').map do |line|
|
103
102
|
pid, ppid, mem, cpu, etime, *cmd = line.split
|
104
103
|
cmd = cmd.join(" ")
|
105
104
|
|
data/lib/snipr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snipr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lance Woodson
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-09 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|