Class: ActionView::StructuredEventSubscriber
- Inherits:
-
ActiveSupport::StructuredEventSubscriber
- Object
- ActiveSupport::Subscriber
- ActiveSupport::StructuredEventSubscriber
- ActionView::StructuredEventSubscriber
- Includes:
- Utils
- Defined in:
- actionview/lib/action_view/structured_event_subscriber.rb
Overview
:nodoc:
Defined Under Namespace
Constant Summary collapse
- VIEWS_PATTERN =
/^app\/views\//
Constants inherited from ActiveSupport::StructuredEventSubscriber
ActiveSupport::StructuredEventSubscriber::DEBUG_CHECK
Instance Attribute Summary
Attributes inherited from ActiveSupport::StructuredEventSubscriber
Attributes inherited from ActiveSupport::Subscriber
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ StructuredEventSubscriber
constructor
A new instance of StructuredEventSubscriber.
- #render_collection(event) ⇒ Object
- #render_layout(event) ⇒ Object
- #render_partial(event) ⇒ Object
- #render_template(event) ⇒ Object
Methods inherited from ActiveSupport::StructuredEventSubscriber
#call, #emit_debug_event, #emit_event, #silenced?
Methods inherited from ActiveSupport::Subscriber
#call, detach_from, method_added, subscribers
Constructor Details
#initialize ⇒ StructuredEventSubscriber
Returns a new instance of StructuredEventSubscriber.
9 10 11 12 |
# File 'actionview/lib/action_view/structured_event_subscriber.rb', line 9 def initialize @root = nil super end |
Class Method Details
.attach_to ⇒ Object
88 89 90 91 92 93 |
# File 'actionview/lib/action_view/structured_event_subscriber.rb', line 88 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) ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# 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_ms: event.duration.round(2), gc_ms: event.gc_time.round(2), cache_hits: event.payload[:cache_hits], count: event.payload[:count], ) end |
#render_layout(event) ⇒ Object
35 36 37 38 39 40 41 |
# 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_ms: event.duration.round(2), gc_ms: event.gc_time.round(2), ) end |
#render_partial(event) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# 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_ms: event.duration.round(2), gc_ms: event.gc_time.round(2), cache_hit: event.payload[:cache_hit], ) end |
#render_template(event) ⇒ Object
14 15 16 17 18 19 20 21 |
# 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_ms: event.duration.round(2), gc_ms: event.gc_time.round(2), ) end |