skylight 0.8.0 → 0.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6b231efb3b8755c457f1316274b958b7cca970b
4
- data.tar.gz: 29de749779071d642006126ac6cf0d80abdd4fcb
3
+ metadata.gz: 24be9df7072117a45c6e4396a7d164551ca75fc7
4
+ data.tar.gz: ca45a492d94fdef72c28a3737c873e30a1e6a735
5
5
  SHA512:
6
- metadata.gz: 13a8e72d5bcd1dc3fa3745ad27411020e1f5d6c9800fbd6d0b963a8a8d0bb0226831b1bb024ab48f30044fc6bbb44b871dda9591934eda213e8ce30701327b8d
7
- data.tar.gz: 74be721ea966f9aa8836e273d41c49b1f392a19ef0f9e4856329460a6d7c76bed665d2c54c4a6dcb0e8ebcd5831d19d9ff6387475be83f589d89d21fb4832264
6
+ metadata.gz: cb70e2c9aeb62bb59df1c1070218cdd18301a8d3280d515969b51751fcf9aedbde0af55b772a96eaa0d0a0b53ab8b38dfe3ef87631721b3545ec4b2270aeeb82
7
+ data.tar.gz: 9d9f034c346ff2ae0c1629092ccdc349d08a598f5ad21c4b78d8fe006bf7ddd641a77a0019b902133867ccb8bb1298f22167cd6d734189df904a1cf948e7cb48
@@ -1,3 +1,10 @@
1
+ ## 0.8.1 (October 1, 2015)
2
+
3
+ * [BUGFIX] Fix agent on OS X El Capitan.
4
+ * [PERFORMANCE] Explicitly subscribe to normalized events
5
+ * [IMPROVEMENT] Use native unique description tracking
6
+ * [IMPROVEMENT] Native SQL: Support multistatement queries
7
+
1
8
  ## 0.8.0 (August 13, 2015)
2
9
 
3
10
  * [FEATURE] Add Grape instumentation. See http://docs.skylight.io/grape
@@ -1,6 +1,6 @@
1
1
  ---
2
- version: "0.7.0-1c24017"
2
+ version: "0.7.0-6aad54d"
3
3
  checksums:
4
- x86-linux: "717333a52e0a9ee3cae0406339a5532e722ec00c77babe71412f02fda60df212"
5
- x86_64-linux: "f63d13680ed9004bd958beb0f1bba6837125b882f005931201f9bcadc435d7f9"
6
- x86_64-darwin: "9da568af9f4b9b2b613a36432b440d0fd705e567159819f9337fa344d42c04f6"
4
+ x86-linux: "a3a16d2de1070d455dae8e46f95c8fa3621adfb062f7b23d629df870d6d7b385"
5
+ x86_64-linux: "c62bcb68c124c5664cf22254c17db68b7f7a3fe6da9148a3f49c546449a9e766"
6
+ x86_64-darwin: "bb42c08044a94332a69c7d343273488d44ed7c85d3f1e2f37834f4ed6cdd178d"
@@ -236,6 +236,30 @@ instrumenter_submit_trace(VALUE self, VALUE rb_trace) {
236
236
  return Qnil;
237
237
  }
238
238
 
239
+ static VALUE
240
+ instrumenter_track_desc(VALUE self, VALUE rb_endpoint, VALUE rb_desc) {
241
+ int tracked;
242
+ sky_instrumenter_t* instrumenter;
243
+
244
+ CHECK_TYPE(rb_endpoint, T_STRING);
245
+ CHECK_TYPE(rb_desc, T_STRING);
246
+
247
+ tracked = 0;
248
+
249
+ My_Struct(instrumenter, sky_instrumenter_t, no_instrumenter_msg);
250
+
251
+ CHECK_FFI(
252
+ sky_instrumenter_track_desc(instrumenter, STR2BUF(rb_endpoint), STR2BUF(rb_desc), &tracked),
253
+ "native Instrumenter#track_desc failed");
254
+
255
+ if (tracked) {
256
+ return Qtrue;
257
+ }
258
+ else {
259
+ return Qfalse;
260
+ }
261
+ }
262
+
239
263
  /*
240
264
  *
241
265
  * class Skylight::Trace
@@ -460,4 +484,5 @@ void Init_skylight_native() {
460
484
  rb_define_method(rb_cInstrumenter, "native_start", instrumenter_start, 0);
461
485
  rb_define_method(rb_cInstrumenter, "native_stop", instrumenter_stop, 0);
462
486
  rb_define_method(rb_cInstrumenter, "native_submit_trace", instrumenter_submit_trace, 1);
487
+ rb_define_method(rb_cInstrumenter, "native_track_desc", instrumenter_track_desc, 2);
463
488
  }
@@ -86,8 +86,6 @@ module Skylight
86
86
  :'auth_url' => 'https://auth.skylight.io/agent',
87
87
  :'sql_mode' => 'ruby',
88
88
  :'daemon.lazy_start' => true,
89
- :'daemon.ssl_cert_path' => Util::SSL.ca_cert_file_or_default,
90
- :'daemon.ssl_cert_dir' => Util::SSL.ca_cert_dir,
91
89
 
92
90
  # == Legacy ==
93
91
  :'log_file' => '-'.freeze,
@@ -111,6 +109,11 @@ module Skylight
111
109
  :'metrics.report_interval' => 60
112
110
  }
113
111
 
112
+ if Skylight::Util::Platform::OS != 'darwin'
113
+ DEFAULTS[:'daemon.ssl_cert_path'] = Util::SSL.ca_cert_file_or_default
114
+ DEFAULTS[:'daemon.ssl_cert_dir'] = Util::SSL.ca_cert_dir
115
+ end
116
+
114
117
  if Skylight.native?
115
118
  native_path = Skylight.libskylight_path
116
119
 
@@ -7,7 +7,6 @@ module Skylight
7
7
  class Instrumenter
8
8
  KEY = :__skylight_current_trace
9
9
  LOCK = Mutex.new
10
- DESC_LOCK = Mutex.new
11
10
 
12
11
  TOO_MANY_UNIQUES = "<too many unique descriptions>"
13
12
 
@@ -87,7 +86,6 @@ module Skylight
87
86
  @subscriber = Subscriber.new(config, self)
88
87
 
89
88
  @trace_info = @config[:trace_info] || TraceInfo.new
90
- @descriptions = Hash.new { |h,k| h[k] = {} }
91
89
  end
92
90
 
93
91
  def current_trace
@@ -227,15 +225,12 @@ module Skylight
227
225
  def limited_description(description)
228
226
  endpoint = @trace_info.current.endpoint
229
227
 
230
- DESC_LOCK.synchronize do
231
- set = @descriptions[endpoint]
232
-
233
- if set.size >= 100
234
- return TOO_MANY_UNIQUES
228
+ if description
229
+ if native_track_desc(endpoint, description)
230
+ description
231
+ else
232
+ TOO_MANY_UNIQUES
235
233
  end
236
-
237
- set[description] = true
238
- description
239
234
  end
240
235
  end
241
236
 
@@ -113,6 +113,10 @@ module Skylight
113
113
  @normalizers = normalizers
114
114
  end
115
115
 
116
+ def keys
117
+ @normalizers.keys
118
+ end
119
+
116
120
  def normalize(trace, name, payload)
117
121
  normalizer_for(name).normalize(trace, name, payload)
118
122
  end
@@ -14,7 +14,8 @@ module Skylight
14
14
 
15
15
  def register!
16
16
  unregister! if @subscriber
17
- @subscriber = ActiveSupport::Notifications.subscribe nil, self
17
+ pattern = ArrayPattern.new(@normalizers.keys)
18
+ @subscriber = ActiveSupport::Notifications.subscribe pattern, self
18
19
  end
19
20
 
20
21
  def unregister!
@@ -22,6 +23,18 @@ module Skylight
22
23
  @subscriber = nil
23
24
  end
24
25
 
26
+ class ArrayPattern
27
+
28
+ def initialize(keys)
29
+ @keys = Set.new keys
30
+ end
31
+
32
+ def ===(item)
33
+ @keys.include?(item)
34
+ end
35
+
36
+ end
37
+
25
38
  #
26
39
  #
27
40
  # ===== ActiveSupport::Notifications API
@@ -1,4 +1,4 @@
1
1
  module Skylight
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skylight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-13 00:00:00.000000000 Z
11
+ date: 2015-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport