Class: Rack::Insight::SpeedTracer::RequestRecord
- Inherits:
-
TraceRecord
- Object
- TraceRecord
- Rack::Insight::SpeedTracer::RequestRecord
show all
- Defined in:
- lib/rack/insight/panels/speedtracer_panel/tracer.rb
Instance Attribute Summary
Attributes inherited from TraceRecord
#children, #start
Instance Method Summary
collapse
Methods inherited from TraceRecord
#duration, #finish, #time_in_children, #to_json
Methods included from Render
#compile, #compile!, #compiled_source, #method_name, #method_name_without_locals, #render_template, #signed_params
Methods included from Logging
logger, verbose, verbosity
Constructor Details
#initialize(id, method, uri) ⇒ RequestRecord
165
166
167
168
169
170
171
172
|
# File 'lib/rack/insight/panels/speedtracer_panel/tracer.rb', line 165
def initialize(id, method, uri)
super()
@id = id
@method = method
@uri = uri
@event_id = 0
end
|
Instance Method Details
#hash_representation ⇒ Object
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
# File 'lib/rack/insight/panels/speedtracer_panel/tracer.rb', line 178
def hash_representation
finish
{ 'trace' => {
'url' => "/__insight__/speedtracer?id=#@id",
'frameStack' => {
'range' => range(@start, @finish),
'operation' => {
'type' => 'HTTP',
'label' => [@method, @uri].join(' ')
},
'children' => @children
},
'resources' => {
'Application' => '/',
'Application.endpoint' => '/'
},
'range' => range(@start, @finish)
}
}
end
|
#to_html ⇒ Object
205
206
207
208
209
210
|
# File 'lib/rack/insight/panels/speedtracer_panel/tracer.rb', line 205
def to_html
hash = hash_representation
= {:self_time => duration - time_in_children}
"<a href='#{hash['trace']['url']}'>Raw JSON</a>\n" +
render_template('panels/speedtracer/serverevent', .merge(symbolize_hash(hash['trace']['frameStack'])))
end
|
#uuid ⇒ Object
174
175
176
|
# File 'lib/rack/insight/panels/speedtracer_panel/tracer.rb', line 174
def uuid
@id
end
|