Class: Rack::Bug::SpeedTrace::ServerEvent
- Inherits:
-
TraceRecord
- Object
- TraceRecord
- Rack::Bug::SpeedTrace::ServerEvent
- Defined in:
- lib/rack/bug/panels/speedtracer_panel/tracer.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from TraceRecord
Instance Method Summary collapse
- #hash_representation ⇒ Object
-
#initialize(id, file, line, method, context, arguments) ⇒ ServerEvent
constructor
A new instance of ServerEvent.
- #to_html ⇒ Object
Methods inherited from TraceRecord
#duration, #finish, #time_in_children, #to_json
Methods included from Render
Methods included from Render
#compile, #compile!, #compiled_source, #method_name, #method_name_without_locals, #render_template, #signed_params
Constructor Details
#initialize(id, file, line, method, context, arguments) ⇒ ServerEvent
Returns a new instance of ServerEvent.
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/rack/bug/panels/speedtracer_panel/tracer.rb', line 55 def initialize(id, file, line, method, context, arguments) super(id) @file = file @line = line @method = method @context = context @arguments = arguments @name = [context, method, "(", arguments, ")"].join("") end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
52 53 54 |
# File 'lib/rack/bug/panels/speedtracer_panel/tracer.rb', line 52 def children @children end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
53 54 55 |
# File 'lib/rack/bug/panels/speedtracer_panel/tracer.rb', line 53 def name @name end |
Instance Method Details
#hash_representation ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/rack/bug/panels/speedtracer_panel/tracer.rb', line 66 def hash_representation { 'range' => range(@start, @finish), #'id' => @id, 'operation' => { # 'sourceCodeLocation' => { # 'className' => @file, # 'methodName' => @method, # 'lineNumber' => @line # }, 'type' => 'METHOD', 'label' => @name }, 'children' => @children } end |
#to_html ⇒ Object
83 84 85 86 |
# File 'lib/rack/bug/panels/speedtracer_panel/tracer.rb', line 83 def to_html render_template('panels/speedtracer/serverevent', {:self_time => duration - time_in_children}.merge(symbolize_hash(hash_representation))) end |