netuitived 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/netuitive/api_emissary.rb +19 -10
- metadata +2 -2
@@ -8,16 +8,25 @@ class APIEmissary
|
|
8
8
|
req = Net::HTTP::Post.new("/ingest/ruby/#{ConfigManager.apiId}", initheader = {'Content-Type' =>'application/json'})
|
9
9
|
req.body = elementString
|
10
10
|
NetuitiveLogger.log.debug "starting post"
|
11
|
-
|
12
|
-
port
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
11
|
+
begin
|
12
|
+
if ConfigManager.port =~ /(.*)nil(.*)/
|
13
|
+
port = nil
|
14
|
+
else
|
15
|
+
port = ConfigManager.port.to_int
|
16
|
+
end
|
17
|
+
NetuitiveLogger.log.debug "port: #{port}"
|
18
|
+
NetuitiveLogger.log.debug "path: #{req.path}"
|
19
|
+
NetuitiveLogger.log.debug "addr: #{ConfigManager.baseAddr}"
|
20
|
+
response = Net::HTTP.start("#{ConfigManager.baseAddr}", port, :use_ssl => true, :read_timeout => 30, :open_timeout => 30) do |http|
|
21
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
22
|
+
http.ssl_version = :SSLv3
|
23
|
+
http.request req
|
24
|
+
end
|
25
|
+
rescue => exception
|
26
|
+
NetuitiveLogger.log.error "error with http post: "
|
27
|
+
NetuitiveLogger.log.error exception.message
|
28
|
+
NetuitiveLogger.log.error exception.backtrace
|
29
|
+
end
|
21
30
|
NetuitiveLogger.log.debug "post finished"
|
22
31
|
if (response.code != "202" or response.code != "200")
|
23
32
|
NetuitiveLogger.log.error "Response from submitting netuitive metrics to api
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netuitived
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Collects metrics over a certain interval and then sends them to Netuitive
|
15
15
|
email: jking@netuitive.com
|