11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/oboe/frameworks/padrino/templates.rb', line 11
def render_with_oboe(engine, data=nil, options={}, locals={}, &block)
if Oboe.tracing?
report_kvs = {}
if data
report_kvs[:engine] = engine
report_kvs[:template] = data
else
report_kvs[:template] = engine
end
if Oboe::Context.tracing_layer_op?('render')
begin
report_kvs[:FunctionName] = :render
report_kvs[:Class] = :Rendering
report_kvs[:Module] = 'Padrino'
report_kvs[:File] = __FILE__
report_kvs[:LineNumber] = __LINE__
rescue StandardError => e
::Oboe.logger.debug e.message
::Oboe.logger.debug e.backtrace.join(", ")
end
Oboe::API.profile(report_kvs[:template], report_kvs, false) do
render_without_oboe(engine, data, options, locals, &block)
end
else
::Oboe::API.log_entry('render', {}, 'render')
begin
render_without_oboe(engine, data, options, locals, &block)
ensure
::Oboe::API.log_exit('render', report_kvs)
end
end
end
end
|