Class: Rack::Insight::SpeedTracer::ServerEvent
- Inherits:
-
TraceRecord
- Object
- TraceRecord
- Rack::Insight::SpeedTracer::ServerEvent
- Defined in:
- lib/rack/insight/panels/speedtracer_panel/tracer.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from TraceRecord
Instance Method Summary collapse
- #hash_representation ⇒ Object
-
#initialize(method_call, 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
#compile, #compile!, #compiled_source, #method_name, #method_name_without_locals, #render_template, #signed_params
Methods included from Logging
Constructor Details
#initialize(method_call, arguments) ⇒ ServerEvent
Returns a new instance of ServerEvent.
135 136 137 138 139 |
# File 'lib/rack/insight/panels/speedtracer_panel/tracer.rb', line 135 def initialize(method_call, arguments) super() @arguments = arguments @name = "#{method_call.context}#{method_call.kind == :instance ? "#" : "::"}#{method_call.method}(#{arguments})" end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
133 134 135 |
# File 'lib/rack/insight/panels/speedtracer_panel/tracer.rb', line 133 def name @name end |
Instance Method Details
#hash_representation ⇒ Object
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/rack/insight/panels/speedtracer_panel/tracer.rb', line 141 def hash_representation { 'range' => range(@start, @finish), 'operation' => { # 'sourceCodeLocation' => { # 'className' => @file, # 'methodName' => @method, # 'lineNumber' => @line # }, 'type' => 'METHOD', 'label' => @name }, 'children' => @children } end |
#to_html ⇒ Object
157 158 159 160 |
# File 'lib/rack/insight/panels/speedtracer_panel/tracer.rb', line 157 def to_html render_template('panels/speedtracer/serverevent', {:self_time => duration - time_in_children}.merge(symbolize_hash(hash_representation))) end |