skylight 0.9.4 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/ext/libskylight.yml +4 -4
- data/ext/skylight_native.c +1 -0
- data/lib/skylight/normalizers.rb +1 -0
- data/lib/skylight/normalizers/active_model_serializers/render.rb +24 -0
- data/lib/skylight/probes/active_model_serializers.rb +55 -0
- data/lib/skylight/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46377b71401533410551ea729a2fc51c14c8ab19
|
4
|
+
data.tar.gz: 98f06fa6bb8032857b23fce319ad91a397e58d1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5348784baea5422f5f4361ff7ee7bf56424783c485a5549e998acb60611c8504d691558a8813efbf2d10a44cfca46b04ecc0e2e7d4d9fa94ff3af1d9479c2cbd
|
7
|
+
data.tar.gz: 99712c702e5d9bc99baee91408a7fc072f2a4bce9271e9eb0fc94f5648f316e8f736950efa2ad20085c7d43dbb0980274343bbfa17474ddc8dff4d002d064d2d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 0.10.0 (December 3, 2015)
|
2
|
+
|
3
|
+
* [FEATURE] ActiveModel::Serializers Instrumentation. Always on in latest HEAD, for previous version add 'active_model_serializers' to probes list.
|
4
|
+
* [BUGFIX] Handle multi-byte characters in SQL lexer
|
5
|
+
|
1
6
|
## 0.9.4 (November 23, 2015)
|
2
7
|
|
3
8
|
* [FEATURE] Added instrumentation for official Mongo Ruby Driver (utilized by Mongoid 5+). Add 'mongo' to probes list to enable.
|
data/ext/libskylight.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
|
-
version: "0.7.0-
|
2
|
+
version: "0.7.0-b2a5f4b"
|
3
3
|
checksums:
|
4
|
-
x86-linux: "
|
5
|
-
x86_64-linux: "
|
6
|
-
x86_64-darwin: "
|
4
|
+
x86-linux: "4ea1f0382dbbba12454d5121a4b400278b2b515b79b676e7d4a2655cdc088bfe"
|
5
|
+
x86_64-linux: "42a958e6fe7f5d9b459e10ffc62c336c44f00e46c253b7f466a72f2902e8e130"
|
6
|
+
x86_64-darwin: "7958533c605d98f43fbe54cdd7f7a6e39d6c8fee30acd29494465213afd123ef"
|
data/ext/skylight_native.c
CHANGED
data/lib/skylight/normalizers.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Skylight
|
2
|
+
module Normalizers
|
3
|
+
module ActiveModelSerializers
|
4
|
+
class Render < Normalizer
|
5
|
+
register "render.active_model_serializers"
|
6
|
+
|
7
|
+
CAT = "view.render.active_model_serializers".freeze
|
8
|
+
|
9
|
+
def normalize(trace, name, payload)
|
10
|
+
serializer_class = payload[:serializer]
|
11
|
+
|
12
|
+
title = serializer_class.name.sub(/^ActiveModel::(Serializer::)?/, '')
|
13
|
+
|
14
|
+
if adapter_instance = payload[:adapter]
|
15
|
+
adapter_name = adapter_instance.class.name.sub(/^ActiveModel::Serializer::Adapter::/, '')
|
16
|
+
desc = "Adapter: #{adapter_name}"
|
17
|
+
end
|
18
|
+
|
19
|
+
[ CAT, title, desc ]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module Skylight
|
2
|
+
module Probes
|
3
|
+
module ActiveModelSerializers
|
4
|
+
class Probe
|
5
|
+
def install
|
6
|
+
version = nil
|
7
|
+
|
8
|
+
# File moved location between version
|
9
|
+
%w(serializer serializers).each do |dir|
|
10
|
+
begin
|
11
|
+
require "active_model/#{dir}/version"
|
12
|
+
rescue LoadError
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
if defined?(::ActiveModel::Serializer::VERSION)
|
17
|
+
version = Gem::Version.new(::ActiveModel::Serializer::VERSION)
|
18
|
+
end
|
19
|
+
|
20
|
+
if !version || version < Gem::Version.new("0.5.0")
|
21
|
+
# Using $stderr here isn't great, but we don't have a logger accessible
|
22
|
+
$stderr.puts "[SKYLIGHT] [#{Skylight::VERSION}] Instrumention is only available for " \
|
23
|
+
"ActiveModelSerializers version 0.5.0 and greater."
|
24
|
+
return
|
25
|
+
end
|
26
|
+
|
27
|
+
# We don't actually support the RCs correctly, requires
|
28
|
+
# a release after 0.10.0.rc3
|
29
|
+
if version >= Gem::Version.new("0.10.0.rc1")
|
30
|
+
# AS::N is built in to newer versions
|
31
|
+
return
|
32
|
+
end
|
33
|
+
|
34
|
+
# End users could override as_json without calling super, but it's likely safer
|
35
|
+
# than overriding serializable_array/hash/object.
|
36
|
+
|
37
|
+
[::ActiveModel::Serializer, ::ActiveModel::ArraySerializer].each do |klass|
|
38
|
+
klass.class_eval do
|
39
|
+
alias as_json_without_sk as_json
|
40
|
+
def as_json(*args)
|
41
|
+
payload = { serializer: self.class }
|
42
|
+
ActiveSupport::Notifications.instrument('render.active_model_serializers', payload) do
|
43
|
+
as_json_without_sk(*args)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
register("ActiveModel::Serializer", "active_model/serializer", ActiveModelSerializers::Probe.new)
|
54
|
+
end
|
55
|
+
end
|
data/lib/skylight/version.rb
CHANGED
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.
|
4
|
+
version: 0.10.0
|
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-
|
11
|
+
date: 2015-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/skylight/normalizers/action_view/render_collection.rb
|
64
64
|
- lib/skylight/normalizers/action_view/render_partial.rb
|
65
65
|
- lib/skylight/normalizers/action_view/render_template.rb
|
66
|
+
- lib/skylight/normalizers/active_model_serializers/render.rb
|
66
67
|
- lib/skylight/normalizers/active_record/sql.rb
|
67
68
|
- lib/skylight/normalizers/active_support/cache.rb
|
68
69
|
- lib/skylight/normalizers/active_support/cache_clear.rb
|
@@ -83,6 +84,7 @@ files:
|
|
83
84
|
- lib/skylight/normalizers/moped/query.rb
|
84
85
|
- lib/skylight/probes.rb
|
85
86
|
- lib/skylight/probes/action_view.rb
|
87
|
+
- lib/skylight/probes/active_model_serializers.rb
|
86
88
|
- lib/skylight/probes/excon.rb
|
87
89
|
- lib/skylight/probes/excon/middleware.rb
|
88
90
|
- lib/skylight/probes/grape.rb
|