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 +4 -4
- data/HISTORY.md +4 -0
- data/lib/wavefront-sdk/defs/version.rb +1 -1
- data/lib/wavefront-sdk/writers/unix.rb +56 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c4118704af3ffb7d99b5de030b6b824fd65347e370aae63790cfeabccfe8f46
|
4
|
+
data.tar.gz: 7c6850c987b13e107cabcf07f6a7fdd100703e258247ea95ec7affddeb083233
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eac7aa649f1aee9ea33ade08f61c5153a3261ce7a85541ecef984c536e2cb8394e63eb7eb1975ac8d136ff92120b2994be66e5e91f8caf71970219604bc089ed
|
7
|
+
data.tar.gz: 6674ea58e42ef802724245ffdd28e8e70ab62f6ba9131b15c295437c8f290f0fecd3daf425d7b257adbc5fde48f829bd3bbd849acd62907792806319bbfc85ee
|
data/HISTORY.md
CHANGED
@@ -1 +1 @@
|
|
1
|
-
WF_SDK_VERSION = '2.0
|
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
|
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-
|
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.
|
309
|
+
rubygems_version: 2.7.8
|
309
310
|
signing_key:
|
310
311
|
specification_version: 4
|
311
312
|
summary: SDK for Wavefront API v2
|