Class: Frame
- Inherits:
-
Object
- Object
- Frame
- Defined in:
- lib/agent/frame.rb
Overview
Ruby version of a Frame Object Self-time is not maintained here, only start and end time
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#endNanos ⇒ Object
Returns the value of attribute endNanos.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#startNanos ⇒ Object
Returns the value of attribute startNanos.
Instance Method Summary collapse
-
#as_json(*a) ⇒ Object
Used to handle the circular reference for the parent frame.
-
#initialize(id, startNanos, endNanos, op, parentFrame = nil, childFrames = []) ⇒ Frame
constructor
A new instance of Frame.
Constructor Details
#initialize(id, startNanos, endNanos, op, parentFrame = nil, childFrames = []) ⇒ Frame
Returns a new instance of Frame.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/agent/frame.rb', line 11 def initialize(id, startNanos, endNanos, op, parentFrame = nil, childFrames=[]) @id = id @startNanos = startNanos @endNanos = endNanos @operation = op @parent = parentFrame @children = childFrames if @startNanos >= @endNanos raise(ArgumentError, "StartNanos " + ("%d" % @startNanos) + " must be less than EndNanos " + ("%d" % @endNanos), Kernel.caller) end end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
23 24 25 |
# File 'lib/agent/frame.rb', line 23 def children @children end |
#endNanos ⇒ Object
Returns the value of attribute endNanos.
23 24 25 |
# File 'lib/agent/frame.rb', line 23 def endNanos @endNanos end |
#operation ⇒ Object
Returns the value of attribute operation.
23 24 25 |
# File 'lib/agent/frame.rb', line 23 def operation @operation end |
#parent ⇒ Object
Returns the value of attribute parent.
23 24 25 |
# File 'lib/agent/frame.rb', line 23 def parent @parent end |
#startNanos ⇒ Object
Returns the value of attribute startNanos.
23 24 25 |
# File 'lib/agent/frame.rb', line 23 def startNanos @startNanos end |
Instance Method Details
#as_json(*a) ⇒ Object
Used to handle the circular reference for the parent frame
26 27 28 29 30 31 32 33 34 |
# File 'lib/agent/frame.rb', line 26 def as_json(*a) { 'id' => @id, 'startNanos' => "%d" % @startNanos, # must not be in scientific notation 'endNanos' => "%d" % @endNanos, 'operation' => @operation, 'children' => @children }.as_json(*a) end |