Skip to content

Commit 8d905db

Browse files
hmcfletchshishirmk
authored andcommitted
taking a crack at the normalizers
1 parent 2da0b5b commit 8d905db

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'fast_jsonapi/instrumentation/skylight/normalizers/serializable_hash'
2+
require 'fast_jsonapi/instrumentation/skylight/normalizers/serialized_json'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'skylight'
2+
require 'fast_jsonapi/instrumentation/serializable_hash'
3+
4+
module FastJsonapi
5+
module Instrumentation
6+
module Skylight
7+
module Normalizers
8+
class SerializableHash < Skylight::Normalizers::Normalizer
9+
10+
register FastJsonapi::ObjectSerializer::SERIALIZABLE_HASH_NOTIFICATION
11+
12+
CAT = "view.#{FastJsonapi::ObjectSerializer::SERIALIZABLE_HASH_NOTIFICATION}".freeze
13+
14+
def normalize(trace, name, payload)
15+
[ CAT, payload[:name], nil ]
16+
end
17+
18+
end
19+
end
20+
end
21+
end
22+
end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'skylight'
2+
require 'fast_jsonapi/instrumentation/serializable_hash'
3+
4+
module FastJsonapi
5+
module Instrumentation
6+
module Skylight
7+
module Normalizers
8+
class SerializedJson < Skylight::Normalizers::Normalizer
9+
10+
register FastJsonapi::ObjectSerializer::SERIALIZED_JSON_NOTIFICATION
11+
12+
CAT = "view.#{FastJsonapi::ObjectSerializer::SERIALIZED_JSON_NOTIFICATION}".freeze
13+
14+
def normalize(trace, name, payload)
15+
[ CAT, payload[:name], nil ]
16+
end
17+
18+
end
19+
end
20+
end
21+
end
22+
end

0 commit comments

Comments
 (0)