rt-watchman 0.2.1 → 0.3.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 +9 -23
- data/watchman.gemspec +2 -0
- metadata +15 -2
- data/lib/watchman/store.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6805c96f578f83f237b0baa56e79106d21aa63e
|
4
|
+
data.tar.gz: 1ad80784f7c6357ea7fa884db8da722ca05c9478
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b1f4fe293cd18d174b6e059a66ebdf78da9c98f7f9bcd542268296f0908b27dc38d5e40c4564316da7f0843f8fbf07653023fd79ed359eeab1dd27e41cf2fe1
|
7
|
+
data.tar.gz: ef2e58f5e102d15a963c1e9f29b5802b510f277194dd2ec1cf20a5b83b19c558f596c383d9e2aafa6176de6116066b4a45203bebee9d169b39dae40f254b49ff
|
data/lib/watchman/version.rb
CHANGED
data/lib/watchman.rb
CHANGED
@@ -1,34 +1,20 @@
|
|
1
1
|
require "watchman/version"
|
2
2
|
require "benchmark"
|
3
|
-
require "
|
3
|
+
require "statsd"
|
4
4
|
|
5
5
|
module Watchman
|
6
|
-
|
6
|
+
extend self
|
7
7
|
|
8
|
-
|
8
|
+
attr_accessor :prefix
|
9
|
+
attr_accessor :host
|
10
|
+
attr_accessor :port
|
9
11
|
|
10
|
-
def
|
11
|
-
@
|
12
|
-
end
|
13
|
-
|
14
|
-
def host=(host)
|
15
|
-
@host = host
|
16
|
-
end
|
17
|
-
|
18
|
-
def host
|
19
|
-
@host
|
20
|
-
end
|
21
|
-
|
22
|
-
def port=(port)
|
23
|
-
@port = port
|
24
|
-
end
|
25
|
-
|
26
|
-
def port
|
27
|
-
@port
|
12
|
+
def statsd_client
|
13
|
+
@client ||= Statsd.new(@host, @port)
|
28
14
|
end
|
29
15
|
|
30
16
|
def submit(name, value)
|
31
|
-
|
17
|
+
statsd_client.gauge(metric_name_with_prefix(name), value)
|
32
18
|
end
|
33
19
|
|
34
20
|
def benchmark(name)
|
@@ -38,7 +24,7 @@ module Watchman
|
|
38
24
|
result = yield
|
39
25
|
end
|
40
26
|
|
41
|
-
|
27
|
+
statsd_client.timing(metric_name_with_prefix(name), (time.real * 1000).floor)
|
42
28
|
|
43
29
|
result
|
44
30
|
end
|
data/watchman.gemspec
CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
+
spec.add_dependency "statsd-ruby", "~> 1.3.0"
|
21
|
+
|
20
22
|
spec.add_development_dependency "bundler", "~> 1.10"
|
21
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
22
24
|
spec.add_development_dependency "rspec"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rt-watchman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rendered Text
|
@@ -10,6 +10,20 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2016-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: statsd-ruby
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.3.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.3.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,7 +83,6 @@ files:
|
|
69
83
|
- bin/console
|
70
84
|
- bin/setup
|
71
85
|
- lib/watchman.rb
|
72
|
-
- lib/watchman/store.rb
|
73
86
|
- lib/watchman/version.rb
|
74
87
|
- watchman.gemspec
|
75
88
|
homepage:
|
data/lib/watchman/store.rb
DELETED