dogapi 1.15.0 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4c6637db33d441d1b9ca96a42a05da93feadb86d
4
+ data.tar.gz: 47f5324fd2483c4397012feed29f1a7820ce40ca
5
+ SHA512:
6
+ metadata.gz: 8d60202a3bd9f248c29dc12bad51fbd435db8e8d3b8101a5ad85b322d3209a43fb6e0a112193b875f80c0ae456b7d848ac547b6bcfb47fe1e62fa6583c65bce7
7
+ data.tar.gz: 12bbf2667aacf481cdb1b2f5cab631dcfbf92ae521d70c56f258526c5ef406a19ec429ba7726fc31ab26608854964e9ea74af25363c2a6241fc5178ef4ad7826
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  Changes
2
2
  =======
3
+ # 1.16.0 / 2015-03-06
4
+ * Return response from API when metrics are sent as a batch. (thanks [@yyuu][] [#62](https://github.com/DataDog/dogapi-rb/pull/62))
5
+
3
6
  # 1.15.0 / 2015-02-03
4
7
  * Encode capistrano output messages to UTF-8 before manipulating them. (thanks [@byroot][] [#52](https://github.com/DataDog/dogapi-rb/pull/52))
5
8
  * Add open_timeout to avoid stuck HTTP calls (thanks [@Kaixiang][] [#55](https://github.com/DataDog/dogapi-rb/pull/55))
@@ -100,8 +103,25 @@ Changes
100
103
  * You do not need to use environment variables anymore to use the client.
101
104
 
102
105
  <!--- The following link definition list is generated by PimpMyChangelog --->
106
+ [#25]: https://github.com/DataDog/dogapi-rb/issues/25
107
+ [#29]: https://github.com/DataDog/dogapi-rb/issues/29
108
+ [#36]: https://github.com/DataDog/dogapi-rb/issues/36
109
+ [#37]: https://github.com/DataDog/dogapi-rb/issues/37
110
+ [#43]: https://github.com/DataDog/dogapi-rb/issues/43
111
+ [#46]: https://github.com/DataDog/dogapi-rb/issues/46
112
+ [#51]: https://github.com/DataDog/dogapi-rb/issues/51
113
+ [#52]: https://github.com/DataDog/dogapi-rb/issues/52
114
+ [#53]: https://github.com/DataDog/dogapi-rb/issues/53
115
+ [#55]: https://github.com/DataDog/dogapi-rb/issues/55
116
+ [#58]: https://github.com/DataDog/dogapi-rb/issues/58
117
+ [#59]: https://github.com/DataDog/dogapi-rb/issues/59
118
+ [#60]: https://github.com/DataDog/dogapi-rb/issues/60
119
+ [#61]: https://github.com/DataDog/dogapi-rb/issues/61
120
+ [#62]: https://github.com/DataDog/dogapi-rb/issues/62
121
+ [@ArjenSchwarz]: https://github.com/ArjenSchwarz
122
+ [@Kaixiang]: https://github.com/Kaixiang
103
123
  [@ansel1]: https://github.com/ansel1
104
124
  [@arielo]: https://github.com/arielo
105
- [@treeder]: https://github.com/treeder
106
- [@Kaixiang]: https://github.com/Kaixiang
107
125
  [@byroot]: https://github.com/byroot
126
+ [@treeder]: https://github.com/treeder
127
+ [@yyuu]: https://github.com/yyuu
data/lib/dogapi/facade.rb CHANGED
@@ -94,7 +94,7 @@ module Dogapi
94
94
  @metric_svc.switch_to_batched
95
95
  begin
96
96
  yield
97
- @metric_svc.flush_buffer
97
+ @metric_svc.flush_buffer # flush_buffer should returns the response from last API call
98
98
  ensure
99
99
  @metric_svc.switch_to_single
100
100
  end
@@ -35,11 +35,13 @@ module Dogapi
35
35
  def submit_to_buffer(metric, points, scope, options = {})
36
36
  payload = self.make_metric_payload(metric, points, scope, options)
37
37
  @buffer << payload
38
+ return 200, {}
38
39
  end
39
40
 
40
41
  def flush_buffer()
41
- self.upload(@buffer)
42
+ payload = @buffer
42
43
  @buffer = nil
44
+ self.upload(payload)
43
45
  end
44
46
 
45
47
  alias :submit :submit_to_api
@@ -1,3 +1,3 @@
1
1
  module Dogapi
2
- VERSION = "1.15.0"
2
+ VERSION = "1.16.0"
3
3
  end
data/spec/facade_spec.rb CHANGED
@@ -17,6 +17,7 @@ describe "Facade", :vcr => true do
17
17
  @service.instance_variable_set(:@uploaded, Array.new)
18
18
  def @service.upload payload
19
19
  @uploaded << payload
20
+ return 200, {}
20
21
  end
21
22
  end
22
23
 
@@ -49,10 +50,11 @@ describe "Facade", :vcr => true do
49
50
  end
50
51
 
51
52
  it "emit_points can be batched" do
52
- @dogmock.batch_metrics do
53
+ code, resp = @dogmock.batch_metrics do
53
54
  @dogmock.emit_point("metric.name", 1, :type => 'counter')
54
55
  @dogmock.emit_point("othermetric.name", 2, :type => 'counter')
55
56
  end
57
+ expect(code).to eq 200
56
58
  # Verify that we uploaded what we expected
57
59
  uploaded = @service.instance_variable_get(:@uploaded)
58
60
  expect(uploaded.length).to eq 1
metadata CHANGED
@@ -1,60 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
5
- prerelease:
4
+ version: 1.16.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Datadog, Inc.
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-02-03 00:00:00.000000000 Z
11
+ date: 2015-03-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: json
16
- requirement: &16861780 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.5.1
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *16861780
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.5.1
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: bundler
27
- requirement: &16860800 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ~>
31
32
  - !ruby/object:Gem::Version
32
33
  version: '1.3'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *16860800
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rake
38
- requirement: &16859820 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
45
  - - ~>
42
46
  - !ruby/object:Gem::Version
43
47
  version: '10'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *16859820
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '10'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: rdoc
49
- requirement: &16858980 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *16858980
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
58
69
  description: Ruby bindings for Datadog's API
59
70
  email:
60
71
  - packages@datadoghq.com
@@ -128,6 +139,7 @@ files:
128
139
  homepage: http://datadoghq.com/
129
140
  licenses:
130
141
  - BSD
142
+ metadata: {}
131
143
  post_install_message:
132
144
  rdoc_options:
133
145
  - --title
@@ -139,22 +151,20 @@ rdoc_options:
139
151
  require_paths:
140
152
  - lib
141
153
  required_ruby_version: !ruby/object:Gem::Requirement
142
- none: false
143
154
  requirements:
144
- - - ! '>='
155
+ - - '>='
145
156
  - !ruby/object:Gem::Version
146
157
  version: '0'
147
158
  required_rubygems_version: !ruby/object:Gem::Requirement
148
- none: false
149
159
  requirements:
150
- - - ! '>='
160
+ - - '>='
151
161
  - !ruby/object:Gem::Version
152
162
  version: '0'
153
163
  requirements: []
154
164
  rubyforge_project:
155
- rubygems_version: 1.8.11
165
+ rubygems_version: 2.0.14
156
166
  signing_key:
157
- specification_version: 3
167
+ specification_version: 4
158
168
  summary: Ruby bindings for Datadog's API
159
169
  test_files:
160
170
  - spec/alerts_spec.rb
@@ -173,3 +183,4 @@ test_files:
173
183
  - spec/support/cassettes/Facade/Events/emits_events_and_retrieves_them.yml
174
184
  - spec/support/cassettes/Facade/Events/emits_events_with_specified_priority.yml
175
185
  - spec/support/cassettes/Facade/Tags/adds_updates_and_detaches_tags.yml
186
+ has_rdoc: true