signalfx 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: c73cef3310b0afe73db2d5eaad2815e3f2f6fe7b
4
- data.tar.gz: 2af5242a79e3334b09cd357bd59b34349fa93480
3
+ metadata.gz: b1e95b59377f963bd7d58da66522048b421077cd
4
+ data.tar.gz: 300ab136c02605ccdf4c984be4d1d8978711868e
5
5
  SHA512:
6
- metadata.gz: ca5b43a50c065795ad6b1fa7c3683f43eb2bab8d8963f351d949e327b2f701bcd484ed74aef60a6c1056bffd4fd26ee170eca6d59701ec23e1b2213bf737c501
7
- data.tar.gz: da0c71273f90a0c20a1aa8b7d6175739dfb2df1a592601fbd3a9b18bc67c70dea84f80fd5f42ca960c163679cf1dfddd7b99c0055d31b59daa87f3e68da64582
6
+ metadata.gz: 146a8cdb0ff97ef3027f4a545051af579860a8a46cee893186f61d6e539774537fa3031317deb7f0127747ce4ce3f915bccd5149435636278d0f07d6113cccb3
7
+ data.tar.gz: d45317cab75adabb588f0b67c5048007e083ac8bc557fc5827b153c55f33dd535a40e37409c9ece1b553d4078ec30b9d8ed7d5d26e0a6adbb7d3a6e0adbdb685
@@ -3,7 +3,7 @@ PATH
3
3
  specs:
4
4
  signalfx (1.0.1)
5
5
  protobuf (~> 3.5.1, >= 3.5.1)
6
- rest-client (~> 1.8)
6
+ rest-client (~> 2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -27,7 +27,9 @@ GEM
27
27
  i18n (0.7.0)
28
28
  json (1.8.3)
29
29
  middleware (0.1.0)
30
- mime-types (2.99.3)
30
+ mime-types (3.1)
31
+ mime-types-data (~> 3.2015)
32
+ mime-types-data (3.2016.0521)
31
33
  minitest (5.9.0)
32
34
  netrc (0.11.0)
33
35
  protobuf (3.5.5)
@@ -36,10 +38,10 @@ GEM
36
38
  thor
37
39
  thread_safe
38
40
  rake (10.4.2)
39
- rest-client (1.8.0)
41
+ rest-client (2.0.0)
40
42
  http-cookie (>= 1.0.2, < 2.0)
41
- mime-types (>= 1.16, < 3.0)
42
- netrc (~> 0.7)
43
+ mime-types (>= 1.16, < 4.0)
44
+ netrc (~> 0.8)
43
45
  rspec (3.3.0)
44
46
  rspec-core (~> 3.3.0)
45
47
  rspec-expectations (~> 3.3.0)
@@ -83,4 +85,4 @@ DEPENDENCIES
83
85
  webmock (~> 2.1)
84
86
 
85
87
  BUNDLED WITH
86
- 1.10.6
88
+ 1.13.1
@@ -20,21 +20,30 @@ module SignalFx
20
20
  # @param timeout - number
21
21
  # @param batch_size - number
22
22
  # @param user_agents - array
23
- def self.new(api_token, enable_aws_unique_id: false, ingest_endpoint: Config::DEFAULT_INGEST_ENDPOINT,
24
- timeout: Config::DEFAULT_TIMEOUT,
25
- batch_size: Config::DEFAULT_BATCH_SIZE, user_agents: [])
23
+ def self.new(api_token,
24
+ enable_aws_unique_id: false,
25
+ ingest_endpoint: RbConfig::DEFAULT_INGEST_ENDPOINT,
26
+ timeout: RbConfig::DEFAULT_TIMEOUT,
27
+ batch_size: RbConfig::DEFAULT_BATCH_SIZE,
28
+ user_agents: [])
26
29
  begin
27
30
  require_relative './proto/signal_fx_protocol_buffers.pb'
28
- ProtoBufSignalFx.new(api_token, enable_aws_unique_id: enable_aws_unique_id, ingest_endpoint: ingest_endpoint,
31
+ ProtoBufSignalFx.new(api_token,
32
+ enable_aws_unique_id: enable_aws_unique_id,
33
+ ingest_endpoint: ingest_endpoint,
29
34
  timeout: timeout,
30
- batch_size: batch_size, user_agents: user_agents)
35
+ batch_size: batch_size,
36
+ user_agents: user_agents)
31
37
 
32
38
  rescue Exception => e
33
- puts "Protocol Buffers not installed properly. Switch to JSON.
39
+ puts "Protocol Buffers not installed properly. Switching to JSON.
34
40
  #{e}"
35
- JsonSignalFx.new(api_token, enable_aws_unique_id: enable_aws_unique_id, ingest_endpoint: ingest_endpoint,
41
+ JsonSignalFx.new(api_token,
42
+ enable_aws_unique_id: enable_aws_unique_id,
43
+ ingest_endpoint: ingest_endpoint,
36
44
  timeout: timeout,
37
- batch_size: batch_size, user_agents: user_agents)
45
+ batch_size: batch_size,
46
+ user_agents: user_agents)
38
47
  end
39
48
  end
40
49
  end
@@ -1,6 +1,6 @@
1
1
  # Copyright (C) 2015-2016 SignalFx, Inc. All rights reserved.
2
2
 
3
- module Config
3
+ module RbConfig
4
4
  # Default Parameters
5
5
  DEFAULT_INGEST_ENDPOINT = 'https://ingest.signalfx.com'
6
6
  DEFAULT_BATCH_SIZE = 300 # Will wait for this many requests before posting
@@ -9,7 +9,7 @@ class JsonSignalFx < SignalFxClient
9
9
  protected
10
10
 
11
11
  def header_content_type
12
- Config::JSON_HEADER_CONTENT_TYPE
12
+ RbConfig::JSON_HEADER_CONTENT_TYPE
13
13
  end
14
14
 
15
15
  def add_to_queue(metric_type, datapoint)
@@ -10,7 +10,7 @@ class ProtoBufSignalFx < SignalFxClient
10
10
  protected
11
11
 
12
12
  def header_content_type
13
- Config::PROTOBUF_HEADER_CONTENT_TYPE
13
+ RbConfig::PROTOBUF_HEADER_CONTENT_TYPE
14
14
  end
15
15
 
16
16
 
@@ -27,9 +27,12 @@ class SignalFxClient
27
27
 
28
28
  $event_categories = EVENT_CATEGORIES
29
29
 
30
- def initialize(api_token, enable_aws_unique_id: false, ingest_endpoint: Config::DEFAULT_INGEST_ENDPOINT,
31
- timeout: Config::DEFAULT_TIMEOUT,
32
- batch_size: Config::DEFAULT_BATCH_SIZE, user_agents: [])
30
+ def initialize(api_token,
31
+ enable_aws_unique_id: false,
32
+ ingest_endpoint: RbConfig::DEFAULT_INGEST_ENDPOINT,
33
+ timeout: RbConfig::DEFAULT_TIMEOUT,
34
+ batch_size: RbConfig::DEFAULT_BATCH_SIZE,
35
+ user_agents: [])
33
36
 
34
37
  @api_token = api_token
35
38
  @ingest_endpoint = ingest_endpoint
@@ -152,7 +155,7 @@ class SignalFxClient
152
155
  }
153
156
 
154
157
  if @aws_unique_id
155
- data[:dimensions][Config::AWS_UNIQUE_ID_DIMENSION_NAME] = @aws_unique_id
158
+ data[:dimensions][RbConfig::AWS_UNIQUE_ID_DIMENSION_NAME] = @aws_unique_id
156
159
  end
157
160
 
158
161
  post(build_event(data), @ingest_endpoint, EVENT_ENDPOINT_SUFFIX)
@@ -222,7 +225,8 @@ class SignalFxClient
222
225
 
223
226
  def retrieve_aws_unique_id(&block)
224
227
  begin
225
- RestClient::Request.execute(method: :get, url: Config::AWS_UNIQUE_ID_URL,
228
+ RestClient::Request.execute(method: :get,
229
+ url: RbConfig::AWS_UNIQUE_ID_URL,
226
230
  timeout: 1) { |response|
227
231
  case response.code
228
232
  when 200
@@ -245,7 +249,7 @@ class SignalFxClient
245
249
  if datapoint[:dimensions] == nil
246
250
  datapoint[:dimensions] = []
247
251
  end
248
- datapoint[:dimensions] << {:key => Config::AWS_UNIQUE_ID_DIMENSION_NAME, :value => @aws_unique_id}
252
+ datapoint[:dimensions] << {:key => RbConfig::AWS_UNIQUE_ID_DIMENSION_NAME, :value => @aws_unique_id}
249
253
  end
250
254
 
251
255
  add_to_queue(metric_type, datapoint)
@@ -1,6 +1,6 @@
1
1
  # Copyright (C) 2015-2016 SignalFx, Inc. All rights reserved.
2
2
 
3
3
  module Version
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  NAME = 'signalfx-ruby-client'
6
6
  end
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "rspec", "~> 3.3"
35
35
  spec.add_development_dependency "webmock", "~> 2.1"
36
36
  spec.add_dependency "protobuf", "~> 3.5.1", ">= 3.5.1"
37
- spec.add_dependency "rest-client", "~> 1.8"
37
+ spec.add_dependency "rest-client", "~> 2.0"
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signalfx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SignalFx, Inc
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-16 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '1.8'
95
+ version: '2.0'
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '1.8'
102
+ version: '2.0'
103
103
  description: This is a programmatic interface in Ruby for SignalFx's metadata and
104
104
  ingest APIs. It is meant to provide a base for communicating with SignalFx APIs
105
105
  that can be easily leveraged by scripts and applications to interact with SignalFx