Class: ActionView::StructuredEventSubscriber
Do not use. This class is for internal use only.
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Classes:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
ActiveSupport::StructuredEventSubscriber
|
Defined in: | actionview/lib/action_view/structured_event_subscriber.rb |
Constant Summary
-
VIEWS_PATTERN =
# File 'actionview/lib/action_view/structured_event_subscriber.rb', line 7/^app\/views\//
::ActiveSupport::StructuredEventSubscriber
- Inherited
Class Attribute Summary
::ActiveSupport::StructuredEventSubscriber
- Inherited
::ActiveSupport::Subscriber
- Inherited
Class Method Summary
- .attach_to
- .new ⇒ StructuredEventSubscriber constructor
::ActiveSupport::StructuredEventSubscriber
- Inherited
::ActiveSupport::Subscriber
- Inherited
.attach_to | Attach the subscriber to a namespace. |
.detach_from | Detach the subscriber from a namespace. |
.method_added | Adds event subscribers for all new methods added to the class. |
.new, .subscribers, .add_event_subscriber, .fetch_public_methods, .find_attached_subscriber, .invalid_event?, .pattern_subscribed?, .prepare_pattern, .remove_event_subscriber |
Instance Attribute Summary
::ActiveSupport::StructuredEventSubscriber
- Inherited
::ActiveSupport::Subscriber
- Inherited
Instance Method Summary
Utils
- Included
::ActiveSupport::StructuredEventSubscriber
- Inherited
#call, | |
#emit_debug_event | Like |
#emit_event | Emit a structured event via Rails.event.notify. |
#silenced?, #handle_event_error |
::ActiveSupport::Subscriber
- Inherited
Constructor Details
.new ⇒ StructuredEventSubscriber
# File 'actionview/lib/action_view/structured_event_subscriber.rb', line 9
def initialize @root = nil super end
Class Method Details
.attach_to
[ GitHub ]# File 'actionview/lib/action_view/structured_event_subscriber.rb', line 87
def self.attach_to(*) ActiveSupport::Notifications.subscribe("render_template.action_view", Start.new) ActiveSupport::Notifications.subscribe("render_layout.action_view", Start.new) super end
Instance Method Details
#render_collection(event)
[ GitHub ]# File 'actionview/lib/action_view/structured_event_subscriber.rb', line 44
def render_collection(event) emit_debug_event("action_view.render_collection", identifier: from_rails_root(event.payload[:identifier] || "templates"), layout: from_rails_root(event.payload[:layout]), duration: event.duration.round(2), gc: event.gc_time.round(2), cache_hits: event.payload[:cache_hits], count: event.payload[:count], ) end
#render_layout(event)
[ GitHub ]# File 'actionview/lib/action_view/structured_event_subscriber.rb', line 35
def render_layout(event) emit_event("action_view.render_layout", identifier: from_rails_root(event.payload[:identifier]), duration: event.duration.round(2), gc: event.gc_time.round(2), ) end
#render_partial(event)
[ GitHub ]# File 'actionview/lib/action_view/structured_event_subscriber.rb', line 24
def render_partial(event) emit_debug_event("action_view.render_partial", identifier: from_rails_root(event.payload[:identifier]), layout: from_rails_root(event.payload[:layout]), duration: event.duration.round(2), gc: event.gc_time.round(2), cache_hit: event.payload[:cache_hit], ) end
#render_template(event)
[ GitHub ]# File 'actionview/lib/action_view/structured_event_subscriber.rb', line 14
def render_template(event) emit_debug_event("action_view.render_template", identifier: from_rails_root(event.payload[:identifier]), layout: from_rails_root(event.payload[:layout]), duration: event.duration.round(2), gc: event.gc_time.round(2), ) end