riemann-rpush 0.0.2 → 0.0.3
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 +4 -4
- data/bin/riemann-rpush +14 -1
- data/riemann-rpush.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78fd53dc3d251144a8e4a2e3166ccf3258f6eb70
|
4
|
+
data.tar.gz: 3a6b5a485e7384476999362a57791cfd3cdecc55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41405ff53ee71dac6eb7a309435f0fcf1db0e0635726957244f11ce6e425703be68b032d29f3c4a7fbf7a585d2e90bdf4a23a74b26e7635a0053e2565358441c
|
7
|
+
data.tar.gz: 590fb77a8a52e21ec2e8d69cbd56104dfafad0798682d0e79854ebe5a0d511ba28d80c4153e9e8125648773599e8b993e6830a6800fa5c88c119975969186578
|
data/bin/riemann-rpush
CHANGED
@@ -9,17 +9,30 @@ class Riemann::Tools::Rpush
|
|
9
9
|
include Riemann::Tools
|
10
10
|
|
11
11
|
opt :redis_url, "Redis URL", :default => ''
|
12
|
+
opt :queue_size_warning, "Queue size warning threshold", :type => Integer, :default => 20
|
13
|
+
opt :queue_size_critical, "Queue size critical threshold", :type => Integer, :default => 100
|
12
14
|
|
13
15
|
def initialize
|
14
16
|
@redis = ::Redis.new({url: opts[:redis_url]})
|
17
|
+
@queue_size_warning = opts.fetch(:queue_size_warning)
|
18
|
+
@queue_size_critical = opts.fetch(:queue_size_critical)
|
15
19
|
end
|
16
20
|
|
17
21
|
def tick
|
18
22
|
queue_size = @redis.scard('rpush:notifications:all')
|
23
|
+
|
24
|
+
state = if queue_size >= @queue_size_critical
|
25
|
+
'critical'
|
26
|
+
elsif queue_size >= @queue_size_warning
|
27
|
+
'warning'
|
28
|
+
else
|
29
|
+
'ok'
|
30
|
+
end
|
31
|
+
|
19
32
|
msg = {
|
20
33
|
metric: queue_size,
|
21
34
|
service: 'rpush queue size',
|
22
|
-
state:
|
35
|
+
state: state
|
23
36
|
}
|
24
37
|
report msg
|
25
38
|
end
|
data/riemann-rpush.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "riemann-rpush"
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.3'
|
8
8
|
spec.authors = ["Fernando Alonso"]
|
9
9
|
spec.email = ["krakatoa1987@gmail.com"]
|
10
10
|
spec.summary = %q{Riemann agent to collect Rpush metrics}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riemann-rpush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Alonso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: riemann-tools
|