application_insights 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/.travis.yml +21 -9
- data/CONTRIBUTING.md +30 -0
- data/Gemfile +4 -4
- data/LICENSE.txt +11 -11
- data/README.md +13 -14
- data/Rakefile +14 -14
- data/application_insights.gemspec +28 -29
- data/lib/application_insights.rb +9 -9
- data/lib/application_insights/channel/asynchronous_queue.rb +58 -51
- data/lib/application_insights/channel/asynchronous_sender.rb +132 -123
- data/lib/application_insights/channel/contracts/application.rb +14 -53
- data/lib/application_insights/channel/contracts/cloud.rb +14 -0
- data/lib/application_insights/channel/contracts/data.rb +14 -48
- data/lib/application_insights/channel/contracts/data_point.rb +24 -130
- data/lib/application_insights/channel/contracts/data_point_type.rb +7 -16
- data/lib/application_insights/channel/contracts/dependency_kind.rb +9 -19
- data/lib/application_insights/channel/contracts/dependency_source_type.rb +9 -19
- data/lib/application_insights/channel/contracts/device.rb +28 -257
- data/lib/application_insights/channel/contracts/envelope.rb +40 -266
- data/lib/application_insights/channel/contracts/event_data.rb +28 -77
- data/lib/application_insights/channel/contracts/exception_data.rb +37 -140
- data/lib/application_insights/channel/contracts/exception_details.rb +28 -129
- data/lib/application_insights/channel/contracts/internal.rb +14 -53
- data/lib/application_insights/channel/contracts/json_serializable.rb +59 -59
- data/lib/application_insights/channel/contracts/location.rb +16 -36
- data/lib/application_insights/channel/contracts/message_data.rb +24 -77
- data/lib/application_insights/channel/contracts/metric_data.rb +27 -60
- data/lib/application_insights/channel/contracts/operation.rb +19 -121
- data/lib/application_insights/channel/contracts/page_view_data.rb +30 -111
- data/lib/application_insights/channel/contracts/remote_dependency_data.rb +56 -260
- data/lib/application_insights/channel/contracts/request_data.rb +36 -176
- data/lib/application_insights/channel/contracts/session.rb +15 -70
- data/lib/application_insights/channel/contracts/severity_level.rb +13 -25
- data/lib/application_insights/channel/contracts/stack_frame.rb +17 -94
- data/lib/application_insights/channel/contracts/user.rb +19 -104
- data/lib/application_insights/channel/event.rb +68 -64
- data/lib/application_insights/channel/queue_base.rb +65 -62
- data/lib/application_insights/channel/sender_base.rb +79 -72
- data/lib/application_insights/channel/synchronous_queue.rb +45 -39
- data/lib/application_insights/channel/synchronous_sender.rb +17 -15
- data/lib/application_insights/channel/telemetry_channel.rb +120 -102
- data/lib/application_insights/channel/telemetry_context.rb +85 -68
- data/lib/application_insights/rack/track_request.rb +87 -84
- data/lib/application_insights/telemetry_client.rb +229 -217
- data/lib/application_insights/unhandled_exception.rb +49 -47
- data/lib/application_insights/version.rb +3 -3
- data/test/application_insights.rb +8 -9
- data/test/application_insights/channel/contracts/test_application.rb +44 -44
- data/test/application_insights/channel/contracts/test_cloud.rb +44 -0
- data/test/application_insights/channel/contracts/test_data.rb +44 -44
- data/test/application_insights/channel/contracts/test_data_point.rb +109 -109
- data/test/application_insights/channel/contracts/test_device.rb +200 -200
- data/test/application_insights/channel/contracts/test_envelope.rb +209 -209
- data/test/application_insights/channel/contracts/test_event_data.rb +62 -62
- data/test/application_insights/channel/contracts/test_exception_data.rb +111 -111
- data/test/application_insights/channel/contracts/test_exception_details.rb +106 -106
- data/test/application_insights/channel/contracts/test_internal.rb +44 -44
- data/test/application_insights/channel/contracts/test_location.rb +70 -31
- data/test/application_insights/channel/contracts/test_message_data.rb +66 -66
- data/test/application_insights/channel/contracts/test_metric_data.rb +50 -50
- data/test/application_insights/channel/contracts/test_operation.rb +109 -96
- data/test/application_insights/channel/contracts/test_page_view_data.rb +88 -88
- data/test/application_insights/channel/contracts/test_remote_dependency_data.rb +209 -209
- data/test/application_insights/channel/contracts/test_request_data.rb +153 -153
- data/test/application_insights/channel/contracts/test_session.rb +57 -57
- data/test/application_insights/channel/contracts/test_stack_frame.rb +83 -83
- data/test/application_insights/channel/contracts/test_user.rb +96 -83
- data/test/application_insights/channel/test_asynchronous_queue.rb +47 -47
- data/test/application_insights/channel/test_asynchronous_sender.rb +80 -80
- data/test/application_insights/channel/test_event.rb +52 -52
- data/test/application_insights/channel/test_queue_base.rb +88 -88
- data/test/application_insights/channel/test_sender_base.rb +87 -87
- data/test/application_insights/channel/test_synchronous_queue.rb +27 -27
- data/test/application_insights/channel/test_synchronous_sender.rb +10 -10
- data/test/application_insights/channel/test_telemetry_channel.rb +126 -102
- data/test/application_insights/channel/test_telemetry_context.rb +82 -74
- data/test/application_insights/mock_sender.rb +37 -37
- data/test/application_insights/rack/test_track_request.rb +142 -139
- data/test/application_insights/test_telemetry_client.rb +133 -123
- data/test/application_insights/test_unhandled_exception.rb +23 -24
- metadata +23 -33
@@ -1,123 +1,133 @@
|
|
1
|
-
require_relative '../../lib/application_insights/telemetry_client'
|
2
|
-
require_relative '../../lib/application_insights/channel/sender_base'
|
3
|
-
require_relative '../../lib/application_insights/channel/synchronous_queue'
|
4
|
-
require_relative '../../lib/application_insights/channel/telemetry_channel'
|
5
|
-
require 'json'
|
6
|
-
require 'test/unit'
|
7
|
-
|
8
|
-
include ApplicationInsights
|
9
|
-
|
10
|
-
class TestTelemetryClient < Test::Unit::TestCase
|
11
|
-
def test_initialize
|
12
|
-
client = TelemetryClient.new
|
13
|
-
assert_not_nil client.context
|
14
|
-
assert_not_nil client.channel
|
15
|
-
|
16
|
-
channel = Object.new
|
17
|
-
client = TelemetryClient.new 'a', channel
|
18
|
-
assert_not_nil client.context
|
19
|
-
assert_same channel, client.channel
|
20
|
-
assert_equal 'a', client.context.instrumentation_key
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_context_property_works_as_expected
|
24
|
-
client = TelemetryClient.new
|
25
|
-
assert_not_nil client.context
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_channel_property_works_as_expected
|
29
|
-
client = TelemetryClient.new
|
30
|
-
assert_not_nil client.channel
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_track_page_view_works_as_expected
|
34
|
-
client, sender = self.create_client
|
35
|
-
client.track_page_view 'test', 'http://tempuri.org'
|
36
|
-
client.flush
|
37
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.PageView","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"PageViewData","baseData":{"ver":2,"url":"http://tempuri.org","name":"test"}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
38
|
-
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
39
|
-
actual = sender.data_to_send.to_json
|
40
|
-
assert_equal expected, actual
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_track_exception_works_as_expected
|
44
|
-
client, sender = self.create_client
|
45
|
-
begin
|
46
|
-
raise ArgumentError, 'Some error'
|
47
|
-
rescue => e
|
48
|
-
client.track_exception e
|
49
|
-
end
|
50
|
-
client.flush
|
51
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Exception","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"ExceptionData","baseData":{"ver":2,"handledAt":"UserCode","exceptions":[{"id":1,"outerId":0,"typeName":"ArgumentError","message":"Some error","hasFullStack":true,"stack":"STACK_PLACEHOLDER"}]}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
52
|
-
assert_equal 'UserCode', sender.data_to_send[0].data.base_data.handled_at
|
53
|
-
assert_operator sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack.count, :>, 0
|
54
|
-
assert_equal 'test_track_exception_works_as_expected', sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack[0].method
|
55
|
-
assert_equal __FILE__, sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack[0].file_name
|
56
|
-
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
57
|
-
sender.data_to_send[0].data.base_data.exceptions[0].stack = 'STACK_PLACEHOLDER'
|
58
|
-
sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack = []
|
59
|
-
actual = sender.data_to_send.to_json
|
60
|
-
assert_equal expected, actual
|
61
|
-
end
|
62
|
-
|
63
|
-
def test_track_event_view_works_as_expected
|
64
|
-
client, sender = self.create_client
|
65
|
-
client.track_event 'test'
|
66
|
-
client.flush
|
67
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Event","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"EventData","baseData":{"ver":2,"name":"test"}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
68
|
-
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
69
|
-
actual = sender.data_to_send.to_json
|
70
|
-
assert_equal expected, actual
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_track_metric_view_works_as_expected
|
74
|
-
client, sender = self.create_client
|
75
|
-
client.track_metric 'test', 42
|
76
|
-
client.flush
|
77
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Metric","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"test","kind":1,"value":42}]}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
78
|
-
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
79
|
-
actual = sender.data_to_send.to_json
|
80
|
-
assert_equal expected, actual
|
81
|
-
end
|
82
|
-
|
83
|
-
def test_track_trace_view_works_as_expected
|
84
|
-
client, sender = self.create_client
|
85
|
-
client.track_trace 'test', Channel::Contracts::SeverityLevel::WARNING
|
86
|
-
client.flush
|
87
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Message","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"test","severityLevel":2}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
88
|
-
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
89
|
-
actual = sender.data_to_send.to_json
|
90
|
-
assert_equal expected, actual
|
91
|
-
end
|
92
|
-
|
93
|
-
def test_track_request_view_works_as_expected
|
94
|
-
client, sender = self.create_client
|
95
|
-
client.track_request 'test', '2015-01-24T23:10:22.7411910-08:00', '0:00:00:02.0000000','200', true
|
96
|
-
client.flush
|
97
|
-
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Request","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"RequestData","baseData":{"ver":2,"id":"test","startTime":"2015-01-24T23:10:22.7411910-08:00","duration":"0:00:00:02.0000000","responseCode":"200","success":true}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
98
|
-
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
99
|
-
actual = sender.data_to_send.to_json
|
100
|
-
assert_equal expected, actual
|
101
|
-
end
|
102
|
-
|
103
|
-
def
|
104
|
-
sender =
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
def
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
1
|
+
require_relative '../../lib/application_insights/telemetry_client'
|
2
|
+
require_relative '../../lib/application_insights/channel/sender_base'
|
3
|
+
require_relative '../../lib/application_insights/channel/synchronous_queue'
|
4
|
+
require_relative '../../lib/application_insights/channel/telemetry_channel'
|
5
|
+
require 'json'
|
6
|
+
require 'test/unit'
|
7
|
+
|
8
|
+
include ApplicationInsights
|
9
|
+
|
10
|
+
class TestTelemetryClient < Test::Unit::TestCase
|
11
|
+
def test_initialize
|
12
|
+
client = TelemetryClient.new
|
13
|
+
assert_not_nil client.context
|
14
|
+
assert_not_nil client.channel
|
15
|
+
|
16
|
+
channel = Object.new
|
17
|
+
client = TelemetryClient.new 'a', channel
|
18
|
+
assert_not_nil client.context
|
19
|
+
assert_same channel, client.channel
|
20
|
+
assert_equal 'a', client.context.instrumentation_key
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_context_property_works_as_expected
|
24
|
+
client = TelemetryClient.new
|
25
|
+
assert_not_nil client.context
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_channel_property_works_as_expected
|
29
|
+
client = TelemetryClient.new
|
30
|
+
assert_not_nil client.channel
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_track_page_view_works_as_expected
|
34
|
+
client, sender = self.create_client
|
35
|
+
client.track_page_view 'test', 'http://tempuri.org'
|
36
|
+
client.flush
|
37
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.PageView","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"PageViewData","baseData":{"ver":2,"url":"http://tempuri.org","name":"test"}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
38
|
+
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
39
|
+
actual = sender.data_to_send.to_json
|
40
|
+
assert_equal expected, actual
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_track_exception_works_as_expected
|
44
|
+
client, sender = self.create_client
|
45
|
+
begin
|
46
|
+
raise ArgumentError, 'Some error'
|
47
|
+
rescue => e
|
48
|
+
client.track_exception e
|
49
|
+
end
|
50
|
+
client.flush
|
51
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Exception","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"ExceptionData","baseData":{"ver":2,"handledAt":"UserCode","exceptions":[{"id":1,"outerId":0,"typeName":"ArgumentError","message":"Some error","hasFullStack":true,"stack":"STACK_PLACEHOLDER"}]}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
52
|
+
assert_equal 'UserCode', sender.data_to_send[0].data.base_data.handled_at
|
53
|
+
assert_operator sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack.count, :>, 0
|
54
|
+
assert_equal 'test_track_exception_works_as_expected', sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack[0].method
|
55
|
+
assert_equal __FILE__, sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack[0].file_name
|
56
|
+
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
57
|
+
sender.data_to_send[0].data.base_data.exceptions[0].stack = 'STACK_PLACEHOLDER'
|
58
|
+
sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack = []
|
59
|
+
actual = sender.data_to_send.to_json
|
60
|
+
assert_equal expected, actual
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_track_event_view_works_as_expected
|
64
|
+
client, sender = self.create_client
|
65
|
+
client.track_event 'test'
|
66
|
+
client.flush
|
67
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Event","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"EventData","baseData":{"ver":2,"name":"test"}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
68
|
+
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
69
|
+
actual = sender.data_to_send.to_json
|
70
|
+
assert_equal expected, actual
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_track_metric_view_works_as_expected
|
74
|
+
client, sender = self.create_client
|
75
|
+
client.track_metric 'test', 42
|
76
|
+
client.flush
|
77
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Metric","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"test","kind":1,"value":42}]}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
78
|
+
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
79
|
+
actual = sender.data_to_send.to_json
|
80
|
+
assert_equal expected, actual
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_track_trace_view_works_as_expected
|
84
|
+
client, sender = self.create_client
|
85
|
+
client.track_trace 'test', Channel::Contracts::SeverityLevel::WARNING
|
86
|
+
client.flush
|
87
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Message","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"test","severityLevel":2}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
88
|
+
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
89
|
+
actual = sender.data_to_send.to_json
|
90
|
+
assert_equal expected, actual
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_track_request_view_works_as_expected
|
94
|
+
client, sender = self.create_client
|
95
|
+
client.track_request 'test', '2015-01-24T23:10:22.7411910-08:00', '0:00:00:02.0000000','200', true
|
96
|
+
client.flush
|
97
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Request","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"RequestData","baseData":{"ver":2,"id":"test","startTime":"2015-01-24T23:10:22.7411910-08:00","duration":"0:00:00:02.0000000","responseCode":"200","success":true}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
98
|
+
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
99
|
+
actual = sender.data_to_send.to_json
|
100
|
+
assert_equal expected, actual
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_track_request_view_works_as_expected_when_request_is_failed
|
104
|
+
client, sender = self.create_client
|
105
|
+
client.track_request 'test', '2015-01-24T23:10:22.7411910-08:00', '0:00:00:02.0000000','200', false
|
106
|
+
client.flush
|
107
|
+
expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Request","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:__version__"},"data":{"baseType":"RequestData","baseData":{"ver":2,"id":"test","startTime":"2015-01-24T23:10:22.7411910-08:00","duration":"0:00:00:02.0000000","responseCode":"200","success":false}}}]'.gsub!(/__version__/, ApplicationInsights::VERSION)
|
108
|
+
sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
|
109
|
+
actual = sender.data_to_send.to_json
|
110
|
+
assert_equal expected, actual
|
111
|
+
end
|
112
|
+
|
113
|
+
def create_client
|
114
|
+
sender = MockTelemetryClientSender.new
|
115
|
+
queue = Channel::SynchronousQueue.new sender
|
116
|
+
channel = Channel::TelemetryChannel.new nil, queue
|
117
|
+
client = TelemetryClient.new nil, channel
|
118
|
+
return client, sender
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
class MockTelemetryClientSender < Channel::SenderBase
|
123
|
+
def initialize
|
124
|
+
super 'http://tempuri.org'
|
125
|
+
@data_to_send = []
|
126
|
+
end
|
127
|
+
|
128
|
+
attr_accessor :data_to_send
|
129
|
+
|
130
|
+
def send(data_to_send)
|
131
|
+
@data_to_send = data_to_send
|
132
|
+
end
|
133
|
+
end
|
@@ -1,24 +1,23 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require_relative 'mock_sender'
|
3
|
-
require_relative '../../lib/application_insights/unhandled_exception'
|
4
|
-
|
5
|
-
include ApplicationInsights
|
6
|
-
|
7
|
-
class TestUnhandledException < Test::Unit::TestCase
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
assert_equal 1, sender.buffer.count
|
20
|
-
|
21
|
-
assert_equal
|
22
|
-
|
23
|
-
|
24
|
-
end
|
1
|
+
require 'test/unit'
|
2
|
+
require_relative 'mock_sender'
|
3
|
+
require_relative '../../lib/application_insights/unhandled_exception'
|
4
|
+
|
5
|
+
include ApplicationInsights
|
6
|
+
|
7
|
+
class TestUnhandledException < Test::Unit::TestCase
|
8
|
+
def test_send
|
9
|
+
sender = MockSynchronousSender.new
|
10
|
+
error = 'Boom!'
|
11
|
+
instrumentation_key = 'one'
|
12
|
+
begin
|
13
|
+
raise StandardError, error
|
14
|
+
rescue
|
15
|
+
UnhandledException.send instrumentation_key, sender
|
16
|
+
end
|
17
|
+
payload = sender.buffer[0]
|
18
|
+
|
19
|
+
assert_equal 1, sender.buffer.count
|
20
|
+
assert_equal instrumentation_key, payload[0].i_key
|
21
|
+
assert_equal 'Unhandled', payload[0].data.base_data.handled_at
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,97 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: application_insights
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.7'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.7'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
|
-
- - ~>
|
17
|
+
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
19
|
version: '10.0'
|
34
20
|
type: :development
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- - ~>
|
24
|
+
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
26
|
version: '10.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: yard
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
|
-
- - ~>
|
31
|
+
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
33
|
+
version: 0.9.11
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- - ~>
|
38
|
+
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
40
|
+
version: 0.9.11
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: redcarpet
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - ~>
|
45
|
+
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: 3.2.2
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - ~>
|
52
|
+
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: 3.2.2
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rack
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- -
|
59
|
+
- - ">="
|
74
60
|
- !ruby/object:Gem::Version
|
75
61
|
version: 1.0.0
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- -
|
66
|
+
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: 1.0.0
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: test-unit
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - ~>
|
73
|
+
- - "~>"
|
88
74
|
- !ruby/object:Gem::Version
|
89
75
|
version: 3.0.8
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - ~>
|
80
|
+
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: 3.0.8
|
97
83
|
description: This project extends the Application Insights API surface to support
|
@@ -102,8 +88,9 @@ executables: []
|
|
102
88
|
extensions: []
|
103
89
|
extra_rdoc_files: []
|
104
90
|
files:
|
105
|
-
- .gitignore
|
106
|
-
- .travis.yml
|
91
|
+
- ".gitignore"
|
92
|
+
- ".travis.yml"
|
93
|
+
- CONTRIBUTING.md
|
107
94
|
- Gemfile
|
108
95
|
- LICENSE.txt
|
109
96
|
- README.md
|
@@ -113,6 +100,7 @@ files:
|
|
113
100
|
- lib/application_insights/channel/asynchronous_queue.rb
|
114
101
|
- lib/application_insights/channel/asynchronous_sender.rb
|
115
102
|
- lib/application_insights/channel/contracts/application.rb
|
103
|
+
- lib/application_insights/channel/contracts/cloud.rb
|
116
104
|
- lib/application_insights/channel/contracts/data.rb
|
117
105
|
- lib/application_insights/channel/contracts/data_point.rb
|
118
106
|
- lib/application_insights/channel/contracts/data_point_type.rb
|
@@ -149,6 +137,7 @@ files:
|
|
149
137
|
- lib/application_insights/version.rb
|
150
138
|
- test/application_insights.rb
|
151
139
|
- test/application_insights/channel/contracts/test_application.rb
|
140
|
+
- test/application_insights/channel/contracts/test_cloud.rb
|
152
141
|
- test/application_insights/channel/contracts/test_data.rb
|
153
142
|
- test/application_insights/channel/contracts/test_data_point.rb
|
154
143
|
- test/application_insights/channel/contracts/test_device.rb
|
@@ -190,23 +179,24 @@ require_paths:
|
|
190
179
|
- lib
|
191
180
|
required_ruby_version: !ruby/object:Gem::Requirement
|
192
181
|
requirements:
|
193
|
-
- -
|
182
|
+
- - ">="
|
194
183
|
- !ruby/object:Gem::Version
|
195
184
|
version: 1.9.3
|
196
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
186
|
requirements:
|
198
|
-
- -
|
187
|
+
- - ">="
|
199
188
|
- !ruby/object:Gem::Version
|
200
189
|
version: '0'
|
201
190
|
requirements: []
|
202
191
|
rubyforge_project:
|
203
|
-
rubygems_version: 2.
|
192
|
+
rubygems_version: 2.5.2
|
204
193
|
signing_key:
|
205
194
|
specification_version: 4
|
206
195
|
summary: Application Insights SDK for Ruby
|
207
196
|
test_files:
|
208
197
|
- test/application_insights.rb
|
209
198
|
- test/application_insights/channel/contracts/test_application.rb
|
199
|
+
- test/application_insights/channel/contracts/test_cloud.rb
|
210
200
|
- test/application_insights/channel/contracts/test_data.rb
|
211
201
|
- test/application_insights/channel/contracts/test_data_point.rb
|
212
202
|
- test/application_insights/channel/contracts/test_device.rb
|