wavefront-sdk 2.0.3 → 2.1.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
  SHA256:
3
- metadata.gz: fca02aa5cfb6552d6623f6e22d2ec23507deb5f4c625dd07ee0c1d39a6ac4922
4
- data.tar.gz: 127aeff281387e1c7b1510c39bd4fdf1a3c1589da49c56caf4859f29635aefba
3
+ metadata.gz: 9c4118704af3ffb7d99b5de030b6b824fd65347e370aae63790cfeabccfe8f46
4
+ data.tar.gz: 7c6850c987b13e107cabcf07f6a7fdd100703e258247ea95ec7affddeb083233
5
5
  SHA512:
6
- metadata.gz: 3cf13219e0f89cb7a5b7cd31b99f836ed1640c451ead825dac2e77d7738a3dde359173fb7dfa6c26bfc44d54b0f2342cae4a3d5963eb2f60d0c4f7d580bbc361
7
- data.tar.gz: 4a0d535006b814fedafb11e8fe28de94617a71bac3f304471788ba76c23f1ddf7be5029e5944c8dac6b5f1414057bfd54eb6a1552c3d0cc4ab915497b109801e
6
+ metadata.gz: eac7aa649f1aee9ea33ade08f61c5153a3261ce7a85541ecef984c536e2cb8394e63eb7eb1975ac8d136ff92120b2994be66e5e91f8caf71970219604bc089ed
7
+ data.tar.gz: 6674ea58e42ef802724245ffdd28e8e70ab62f6ba9131b15c295437c8f290f0fecd3daf425d7b257adbc5fde48f829bd3bbd849acd62907792806319bbfc85ee
data/HISTORY.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.0 (25/11/2018)
4
+ * New `unix` writer lets you write points to a local Unix datagram
5
+ socket.
6
+
3
7
  ## 2.0.3 (23/10/2018)
4
8
  * Remove unnecessarily strict argument check on `event#list`.
5
9
 
@@ -1 +1 @@
1
- WF_SDK_VERSION = '2.0.3'.freeze
1
+ WF_SDK_VERSION = '2.1.0'.freeze
@@ -0,0 +1,56 @@
1
+ require 'socket'
2
+ require_relative 'core'
3
+
4
+ module Wavefront
5
+ module Writer
6
+ #
7
+ # Everything specific to writing points to a Unix datagram
8
+ # socket.
9
+ #
10
+ class Unix < Core
11
+ # Make a connection to a Unix datagram socket, putting the
12
+ # descriptor in instance variable @conn.
13
+ # This requires the name of the socket file in creds[:socket]
14
+ # @return [UnixSocket]
15
+ #
16
+ def open
17
+ if opts[:noop]
18
+ logger.log('No-op requested. Not opening socket connection.')
19
+ return true
20
+ end
21
+
22
+ logger.log("Connecting to #{creds[:socket]}.", :debug)
23
+
24
+ begin
25
+ @conn = UNIXSocket.new(creds[:socket])
26
+ rescue StandardError => e
27
+ logger.log(e, :error)
28
+ raise Wavefront::Exception::InvalidEndpoint
29
+ end
30
+ end
31
+
32
+ def close
33
+ return if opts[:noop]
34
+
35
+ logger.log('Closing socket connection.', :debug)
36
+ conn.close
37
+ end
38
+
39
+ def validate_credentials(creds)
40
+ return true if creds.key?(:socket)
41
+
42
+ raise(Wavefront::Exception::CredentialError,
43
+ 'creds must contain socket file path')
44
+ end
45
+
46
+ private
47
+
48
+ # @param point [String] point or points in native Wavefront
49
+ # format.
50
+ #
51
+ def _send_point(point)
52
+ conn.write(point)
53
+ end
54
+ end
55
+ end
56
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wavefront-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Fisher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -239,6 +239,7 @@ files:
239
239
  - lib/wavefront-sdk/writers/http.rb
240
240
  - lib/wavefront-sdk/writers/socket.rb
241
241
  - lib/wavefront-sdk/writers/summary.rb
242
+ - lib/wavefront-sdk/writers/unix.rb
242
243
  - lib/wavefront_sdk.rb
243
244
  - spec/.rubocop.yml
244
245
  - spec/spec_helper.rb
@@ -305,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
306
  version: '0'
306
307
  requirements: []
307
308
  rubyforge_project:
308
- rubygems_version: 2.7.7
309
+ rubygems_version: 2.7.8
309
310
  signing_key:
310
311
  specification_version: 4
311
312
  summary: SDK for Wavefront API v2