graphite-api 1.1.0 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0595ca2197bbdfe81fd61a7fc06f4949adea392b2c3ca7aee0d4c461eccb7479'
4
- data.tar.gz: 4a8df14d1e1f7a7a39fde283eae647668f08c6ce4005a5dc4e435153cba417d0
3
+ metadata.gz: d50632fe72c8e0fc44147eb168f3dd17c101fb9b4aed09e80f4bbade1dd13d6e
4
+ data.tar.gz: 0b53596ecaf05cd76f9eee89090f866fcf473758b6eceeaaba2a028c2314d2e4
5
5
  SHA512:
6
- metadata.gz: 5373a60c92806962795637d6ab23bedf523db35a02fcaf6ae8f99b699c8f0e97e3aed3d952e03b891db1dde3c9388a7224a9753871b0b05f76be39bbd13730c5
7
- data.tar.gz: 8148064e7eeeaa35847b8f50dc153cb33aa13277f2cab8b25a8c6d3570eb1bd33c59845550d2d7c25cdd58465305f24ee2d0d5df0e1362943b86a9ac2a40a287
6
+ metadata.gz: e041f476a94cd70a43017381dfb70eb5d7b6f2762691dc6623f1478fa465bfe3efeabded13bef0050ba945d4d0614b5c4ecbbbea987365724f033303f261fcc5
7
+ data.tar.gz: be6a6b8b83db733042141fc2c62dffe275cd279a58d057329b00e5c6c939eecc6182b58f70a5941bbc37c79b4c45a13afd1fd31201a087f4cbdd595d75482075
@@ -13,11 +13,11 @@ module GraphiteAPI
13
13
  def_delegator :buffer, :stream
14
14
 
15
15
  attr_reader :options, :buffer, :connectors, :mu
16
- private :options, :buffer, :connectors, :mu
16
+ private :options, :buffer, :connectors, :mu
17
17
 
18
18
  def initialize opt
19
19
  @options = build_options validate opt.clone
20
- @buffer = GraphiteAPI::Buffer.new options, timers
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 { t.wait } } }
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
 
@@ -1,3 +1,3 @@
1
1
  module GraphiteAPI
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
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.0
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-03-25 00:00:00.000000000 Z
11
+ date: 2019-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timers