Class: Rack::SpeedTracer::ServerEvent
- Inherits:
-
TraceRecord
- Object
- TraceRecord
- Rack::SpeedTracer::ServerEvent
- Defined in:
- lib/rack/speedtracer/tracer.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
Instance Method Summary collapse
-
#initialize(id, file, line, method, name) ⇒ ServerEvent
constructor
A new instance of ServerEvent.
- #to_json ⇒ Object
Methods inherited from TraceRecord
Constructor Details
#initialize(id, file, line, method, name) ⇒ ServerEvent
Returns a new instance of ServerEvent.
27 28 29 30 31 32 33 34 |
# File 'lib/rack/speedtracer/tracer.rb', line 27 def initialize(id, file, line, method, name) super(id) @file = file @line = line @method = method @name = name end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
25 26 27 |
# File 'lib/rack/speedtracer/tracer.rb', line 25 def children @children end |
Instance Method Details
#to_json ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/rack/speedtracer/tracer.rb', line 36 def to_json Yajl::Encoder.encode({ 'range' => range(@start, @finish), 'id' => @id, 'operation' => { 'sourceCodeLocation' => { 'className' => @file, 'methodName' => @method, 'lineNumber' => @line }, 'type' => 'METHOD', 'label' => @name }, 'children' => @children }) end |