graphite-api 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphite-api/client.rb +8 -6
- data/lib/graphite-api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d50632fe72c8e0fc44147eb168f3dd17c101fb9b4aed09e80f4bbade1dd13d6e
|
4
|
+
data.tar.gz: 0b53596ecaf05cd76f9eee89090f866fcf473758b6eceeaaba2a028c2314d2e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e041f476a94cd70a43017381dfb70eb5d7b6f2762691dc6623f1478fa465bfe3efeabded13bef0050ba945d4d0614b5c4ecbbbea987365724f033303f261fcc5
|
7
|
+
data.tar.gz: be6a6b8b83db733042141fc2c62dffe275cd279a58d057329b00e5c6c939eecc6182b58f70a5941bbc37c79b4c45a13afd1fd31201a087f4cbdd595d75482075
|
data/lib/graphite-api/client.rb
CHANGED
@@ -13,11 +13,11 @@ module GraphiteAPI
|
|
13
13
|
def_delegator :buffer, :stream
|
14
14
|
|
15
15
|
attr_reader :options, :buffer, :connectors, :mu
|
16
|
-
private
|
16
|
+
private :options, :buffer, :connectors, :mu
|
17
17
|
|
18
18
|
def initialize opt
|
19
19
|
@options = build_options validate opt.clone
|
20
|
-
@buffer
|
20
|
+
@buffer = GraphiteAPI::Buffer.new options, timers
|
21
21
|
@connectors = GraphiteAPI::Connector::Group.new options
|
22
22
|
@mu = Mutex.new
|
23
23
|
|
@@ -25,7 +25,9 @@ module GraphiteAPI
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def timers
|
28
|
-
@timers ||= Timers::Group.new.tap {|t| Thread.new { loop {
|
28
|
+
@timers ||= Timers::Group.new.tap { |t| Thread.new { loop {
|
29
|
+
t.wait { |n| sleep(n.nil? ? 0.1 : [n, 0].max) }
|
30
|
+
} } }
|
29
31
|
end
|
30
32
|
|
31
33
|
# throw exception on Socket error
|
@@ -46,9 +48,9 @@ module GraphiteAPI
|
|
46
48
|
def increment(*keys)
|
47
49
|
opt = {}
|
48
50
|
opt.merge! keys.pop if keys.last.is_a? Hash
|
49
|
-
by = opt.fetch(:by,1)
|
50
|
-
time = opt.fetch(:time,Time.now)
|
51
|
-
metric = keys.inject({}) {|h,k| h.merge k => by }
|
51
|
+
by = opt.fetch(:by, 1)
|
52
|
+
time = opt.fetch(:time, Time.now)
|
53
|
+
metric = keys.inject({}) { |h, k| h.merge k => by }
|
52
54
|
metrics(metric, time)
|
53
55
|
end
|
54
56
|
|
data/lib/graphite-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphite-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eran Barak Levi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: timers
|