application_insights 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmMxYzA0NzMxMzA2MThlYTIzMWViZTE1N2JjZWIxMDkwNmNiODRlZQ==
4
+ OTRkZjYzYTNhMmU2NTc1ZTJiNGY5Zjc1YjIwZGVhMTFhZWYyNGMwZQ==
5
5
  data.tar.gz: !binary |-
6
- MWJkMjg1NGIxN2MzMDY5YTRmM2QwYjU5MzlkMmYwN2Y2MWZlODQ4Yw==
6
+ NzM5ODdlMTYxNmM4OTNlODM0MWE2MzY1OTc2Y2Q0YzZiYmE3YTJjNw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZTA2MWJiY2E1ZmU2MzkyNTUyNzY2MmZmYTQwYmI4YzcyZDQyYzU4ZDg2NWE4
10
- Yjg5ZTcwNzY0ZmFiNGI2YjZlMzRlY2JmNTQ2MGUxNmYwMWYwNTA4NDViYjFj
11
- MWZlMDdkYzk1MDFmNzIyZWQyN2M0NDFjNjFlNWJhOWYzZjBhZDU=
9
+ ODNmYWQ0M2NmMzQxMGMyZDM2Y2RmYzg5YWM0M2U1MjgyYTJiZjM0OWUxMjVj
10
+ ZjE0M2Q5NzhlMjBhM2MxOWI0ODg1MTRiMWNhNDZhYWEwN2Y5N2FjYWQxNzQ2
11
+ N2VjMWE0OTY2NWI4ZGJjODE0YTIxYWE0OTFjZTRlZGZmMDkzODM=
12
12
  data.tar.gz: !binary |-
13
- NGRlMzIzMzBlNDkyZmE4MzRlMWI5YTgxOGJkOWUyN2UyMDUyYTMwNzQwOGE4
14
- NmQzMjQyZDAwOTEyODA2NjNhODkzYWY5YmMwNGE0Zjc5MDQ5NTFhOWM1MjE3
15
- YzIyMGU5ZDVjMWNlMWVmZmYxMmVhYzExM2YxZThmMTY5NjAyMTM=
13
+ NDZjZmU3NTRhMzY2MmI2MzlkMDcyNGM4ZWRiOWY3NGJlZTI4NTIzZjVhNzEy
14
+ OTVkZGJjNTcwOTEyY2YwNzc4ZjRkNWNhNjk4YmQxNDgyODQ2NjY2MWVjYTQz
15
+ MzJlMjhiMTc4MTEzNjYxNmIwMGUzYjc0NjY5MWY0MmEwNzM1Zjg=
@@ -55,15 +55,6 @@ module ApplicationInsights
55
55
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
56
56
  end
57
57
  response = http.request(request)
58
-
59
- case response
60
- when Net::HTTPSuccess, Net::HTTPRedirection, Net::HTTPBadRequest
61
- return
62
- else
63
- data_to_send.each do |item|
64
- @queue.push item
65
- end
66
- end
67
58
  end
68
59
 
69
60
  private
@@ -7,6 +7,7 @@ require_relative 'synchronous_sender'
7
7
  require_relative 'contracts/envelope'
8
8
  require_relative 'contracts/data'
9
9
  require_relative 'contracts/internal'
10
+ require_relative '../../application_insights/version'
10
11
 
11
12
  module ApplicationInsights
12
13
  module Channel
@@ -77,7 +78,7 @@ module ApplicationInsights
77
78
  def get_tags(context)
78
79
  hash = {}
79
80
  internal_context_attributes = {
80
- :sdk_version => 'rb:0.1.0'
81
+ :sdk_version => 'rb:' + ApplicationInsights::VERSION
81
82
  }
82
83
  internal_context = Contracts::Internal.new internal_context_attributes
83
84
  contexts = [ internal_context, context.application, context.device, context.user, context.session, context.location, context.operation ]
@@ -1,3 +1,3 @@
1
1
  module ApplicationInsights
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2'
3
3
  end
@@ -51,7 +51,7 @@ class TestSenderBase < Test::Unit::TestCase
51
51
  sender.queue = []
52
52
  sender.send([1, 2])
53
53
  thread.join
54
- assert_equal [1, 2], sender.queue
54
+ assert_equal [], sender.queue
55
55
  end
56
56
 
57
57
  def execute_server(code)
@@ -66,7 +66,7 @@ class TestTelemetryChannel < Test::Unit::TestCase
66
66
  assert_equal 'instrumentation key', actual.i_key
67
67
  assert_not_nil actual.tags
68
68
  assert_equal 1, actual.tags.count
69
- assert_equal 'rb:0.1.0', actual.tags['ai.internal.sdkVersion']
69
+ assert_equal 'rb:'+ ApplicationInsights::VERSION, actual.tags['ai.internal.sdkVersion']
70
70
  assert_not_nil actual.data
71
71
  assert_equal 'MockTelemetryItemData', actual.data.base_type
72
72
  assert_same expected, actual.data.base_data
@@ -34,7 +34,7 @@ class TestTelemetryClient < Test::Unit::TestCase
34
34
  client, sender = self.create_client
35
35
  client.track_page_view 'test', 'http://tempuri.org'
36
36
  client.flush
37
- expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.PageView","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:0.1.0"},"data":{"baseType":"PageViewData","baseData":{"ver":2,"url":"http://tempuri.org","name":"test"}}}]'
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
38
  sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
39
39
  actual = sender.data_to_send.to_json
40
40
  assert_equal expected, actual
@@ -48,7 +48,7 @@ class TestTelemetryClient < Test::Unit::TestCase
48
48
  client.track_exception e
49
49
  end
50
50
  client.flush
51
- expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Exception","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:0.1.0"},"data":{"baseType":"ExceptionData","baseData":{"ver":2,"handledAt":"UserCode","exceptions":[{"id":1,"outerId":0,"typeName":"ArgumentError","message":"Some error","hasFullStack":true,"stack":"STACK_PLACEHOLDER"}]}}}]'
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
52
  assert_equal 'UserCode', sender.data_to_send[0].data.base_data.handled_at
53
53
  assert_operator sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack.count, :>, 0
54
54
  assert_equal 'test_track_exception_works_as_expected', sender.data_to_send[0].data.base_data.exceptions[0].parsed_stack[0].method
@@ -64,7 +64,7 @@ class TestTelemetryClient < Test::Unit::TestCase
64
64
  client, sender = self.create_client
65
65
  client.track_event 'test'
66
66
  client.flush
67
- expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Event","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:0.1.0"},"data":{"baseType":"EventData","baseData":{"ver":2,"name":"test"}}}]'
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
68
  sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
69
69
  actual = sender.data_to_send.to_json
70
70
  assert_equal expected, actual
@@ -74,7 +74,7 @@ class TestTelemetryClient < Test::Unit::TestCase
74
74
  client, sender = self.create_client
75
75
  client.track_metric 'test', 42
76
76
  client.flush
77
- expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Metric","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:0.1.0"},"data":{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"test","kind":1,"value":42}]}}}]'
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
78
  sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
79
79
  actual = sender.data_to_send.to_json
80
80
  assert_equal expected, actual
@@ -84,7 +84,7 @@ class TestTelemetryClient < Test::Unit::TestCase
84
84
  client, sender = self.create_client
85
85
  client.track_trace 'test', Channel::Contracts::SeverityLevel::WARNING
86
86
  client.flush
87
- expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Message","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:0.1.0"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"test","severityLevel":2}}}]'
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
88
  sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
89
89
  actual = sender.data_to_send.to_json
90
90
  assert_equal expected, actual
@@ -94,7 +94,7 @@ class TestTelemetryClient < Test::Unit::TestCase
94
94
  client, sender = self.create_client
95
95
  client.track_request 'test', '2015-01-24T23:10:22.7411910-08:00', '0:00:00:02.0000000','200', true
96
96
  client.flush
97
- expected = '[{"ver":1,"name":"Microsoft.ApplicationInsights.Request","time":"TIME_PLACEHOLDER","sampleRate":100.0,"tags":{"ai.internal.sdkVersion":"rb:0.1.0"},"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}}}]'
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
98
  sender.data_to_send[0].time = 'TIME_PLACEHOLDER'
99
99
  actual = sender.data_to_send.to_json
100
100
  assert_equal expected, actual
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: application_insights
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-11 00:00:00.000000000 Z
11
+ date: 2015-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler