-
Notifications
You must be signed in to change notification settings - Fork 90
Add Instrumentation Support with ActiveSupport::Notifications #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -24,4 +24,5 @@ Gem::Specification.new do |spec| | |||
spec.add_development_dependency "rspec", "~> 3.2" | |||
spec.add_development_dependency "factory_girl", "~> 4.5" | |||
spec.add_development_dependency "activemodel", "~> 4.2" | |||
spec.add_development_dependency "pry" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove if you want but it was nice to have.
@@ -16,6 +17,7 @@ def serialize_primary(object, options = {}) | |||
primary_data = serialize_primary(nil, {serializer: MyApp::PostSerializer}) | |||
expect(primary_data).to be_nil | |||
end | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🌮
We'll make this a major version bump.
released in jsonapi-serializers (2.0.0.pre.beta.1) |
Using ActiveSupport::Notifications this PR allows you to subscribe to key notifications to better understand the performance of your serialization.
The following notifications can be subscribed to:
render.jsonapi_serializers.serialize_primary
- time spent serializing a single objectrender.jsonapi_serializers.find_recursive_relationships
- time spent finding objects to serialize through relationshipsThis is an example of how you might subscribe to all events that come from
jsonapi-serializers
.