telemetry 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/telemetry/config_parser.rb +2 -0
- data/lib/telemetry/telemetry.rb +6 -4
- data/lib/telemetry/version.rb +1 -1
- metadata +2 -2
data/lib/telemetry/telemetry.rb
CHANGED
@@ -11,18 +11,16 @@ module Telemetry
|
|
11
11
|
|
12
12
|
RestClient.proxy = ENV['http_proxy'] if ENV['http_proxy']
|
13
13
|
|
14
|
-
uri = "
|
14
|
+
uri = "https://#{Telemetry.token}:@data.telemetryapp.com/v1/data.json"
|
15
15
|
body = MultiJson.dump({:data => data})
|
16
16
|
|
17
|
-
puts "#{Time.now} Updating Data (#{data.keys.join(", ")})"
|
18
|
-
|
19
17
|
begin
|
20
18
|
response = RestClient.post(uri, body, :content_type => :json, :accept => :json) do |response, request, result|
|
21
19
|
case response.code
|
22
20
|
when 200
|
23
21
|
json = MultiJson.load(response)
|
24
22
|
if json
|
25
|
-
puts "#{Time.now} Update OK: Updated #{json["updated"].count} flows
|
23
|
+
puts "#{Time.now} Update OK: Updated #{json["updated"].count} flows" if json["updated"] && json["updated"].count > 0
|
26
24
|
puts "#{Time.now} Update OK: Skipped #{json["skipped"].count} flows (#{json["skipped"].join(", ")})" if json["skipped"] && json["skipped"].count > 0
|
27
25
|
puts "#{Time.now} Update OK: Errors with #{json["errors"].count} flows (#{json["errors"].join(", ")})" if json["errors"] && json["errors"].count > 0
|
28
26
|
end
|
@@ -57,6 +55,10 @@ module Telemetry
|
|
57
55
|
rescue Errno::ECONNREFUSED => e
|
58
56
|
puts "#{Time.now} ERROR #{e}"
|
59
57
|
sleep 60
|
58
|
+
|
59
|
+
rescue Exception => e
|
60
|
+
puts "#{Time.now} ERROR #{e}"
|
61
|
+
sleep 60
|
60
62
|
end
|
61
63
|
end
|
62
64
|
end
|
data/lib/telemetry/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telemetry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.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: 2013-
|
12
|
+
date: 2013-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oj
|