Class: ActionView::StructuredEventSubscriber
- Inherits:
-
ActiveSupport::StructuredEventSubscriber
- Object
- ActiveSupport::StructuredEventSubscriber
- ActionView::StructuredEventSubscriber
show all
- Includes:
- Utils
- Defined in:
- lib/action_view/structured_event_subscriber.rb
Overview
Defined Under Namespace
Modules: Utils
Classes: Start
Constant Summary
collapse
- VIEWS_PATTERN =
/^app\/views\//
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
9
10
11
12
|
# File '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 '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 '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 '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 '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 '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
|