rt-watchman 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/watchman/version.rb +1 -1
- data/lib/watchman.rb +13 -2
- 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: 587c0ec89be179caee4a0e3ac13bb2ba38a4df2b
|
4
|
+
data.tar.gz: ea5f5a91054141741c82331fbe0461504b4abe46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df12524ac71c3ce2d97eeabbc4822a1a68723ea71aa4ad30373f3e0727405f0f0d3f1aa7695cca0313eb7e5863619ba74c5f2a9631d9b89fa4c4211e5719e55b
|
7
|
+
data.tar.gz: 4a4ee43021e4f32e617ec8af450390ee9141812d758c3145f2dc4e13efefe7bd4892983bab0a9f56aa992d3e19660ba3928c2c07054d981ba4d3b995bd5c68dc
|
data/lib/watchman/version.rb
CHANGED
data/lib/watchman.rb
CHANGED
@@ -11,9 +11,12 @@ class Watchman
|
|
11
11
|
attr_accessor :port
|
12
12
|
|
13
13
|
def submit(name, value, type = :gauge)
|
14
|
+
metric = metric_name_with_prefix(name)
|
15
|
+
|
14
16
|
case type
|
15
|
-
when :gauge
|
16
|
-
when :timing
|
17
|
+
when :gauge then statsd_client.gauge(metric, value)
|
18
|
+
when :timing then statsd_client.timing(metric, value)
|
19
|
+
when :count then statsd_client.count(metric, value)
|
17
20
|
else raise SubmitTypeError.new("Submit type '#{type}' is not recognized")
|
18
21
|
end
|
19
22
|
end
|
@@ -30,6 +33,14 @@ class Watchman
|
|
30
33
|
result
|
31
34
|
end
|
32
35
|
|
36
|
+
def increment(name)
|
37
|
+
submit(name, 1, :count)
|
38
|
+
end
|
39
|
+
|
40
|
+
def decrement(name)
|
41
|
+
submit(name, -1, :count)
|
42
|
+
end
|
43
|
+
|
33
44
|
private
|
34
45
|
|
35
46
|
def statsd_client
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rt-watchman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rendered Text
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: statsd-ruby
|