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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bac90f85de8c5c8965929b5437690acca82046a
4
- data.tar.gz: b1078845f612cba2dcd31035e85a22dd5b52cdba
3
+ metadata.gz: 587c0ec89be179caee4a0e3ac13bb2ba38a4df2b
4
+ data.tar.gz: ea5f5a91054141741c82331fbe0461504b4abe46
5
5
  SHA512:
6
- metadata.gz: dbb99b527956fdac75affe4e32c611f111c12187a04ea8bdbf3a2eb540a72011e389178776e5fa14ad40ea5f5dada2b9792a1015ae5c928c3b922da5773918f1
7
- data.tar.gz: 5f5ab2085d32b0a6bb44e1876cf03510d01ff29378f9307375ca3cd2e20b75e27a002ac934fce91641ef2a4e316c35d0bc2353b0f9074de57ca6f4ab49f31e6e
6
+ metadata.gz: df12524ac71c3ce2d97eeabbc4822a1a68723ea71aa4ad30373f3e0727405f0f0d3f1aa7695cca0313eb7e5863619ba74c5f2a9631d9b89fa4c4211e5719e55b
7
+ data.tar.gz: 4a4ee43021e4f32e617ec8af450390ee9141812d758c3145f2dc4e13efefe7bd4892983bab0a9f56aa992d3e19660ba3928c2c07054d981ba4d3b995bd5c68dc
@@ -1,3 +1,3 @@
1
1
  class Watchman
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
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 then statsd_client.gauge(metric_name_with_prefix(name), value)
16
- when :timing then statsd_client.timing(metric_name_with_prefix(name), value)
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.5.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-08-11 00:00:00.000000000 Z
11
+ date: 2016-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: statsd-ruby