Class: Flows::Plugin::Profiler::Report::Tree::Node Private

Inherits:
Object
  • Object
show all
Defined in:
lib/flows/plugin/profiler/report/tree/node.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subject:) ⇒ Node

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Node.

Since:

  • 0.4.0



11
12
13
14
15
16
17
# File 'lib/flows/plugin/profiler/report/tree/node.rb', line 11

def initialize(subject:)
  @subject = subject
  @children = {}
  @cache = {}

  @executions = []
end

Instance Attribute Details

#executionsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



9
10
11
# File 'lib/flows/plugin/profiler/report/tree/node.rb', line 9

def executions
  @executions
end

#subjectObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



8
9
10
# File 'lib/flows/plugin/profiler/report/tree/node.rb', line 8

def subject
  @subject
end

Instance Method Details

#[](subject) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



19
20
21
# File 'lib/flows/plugin/profiler/report/tree/node.rb', line 19

def [](subject)
  @children[subject] ||= Node.new(subject: subject)
end

#childrenObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



23
24
25
# File 'lib/flows/plugin/profiler/report/tree/node.rb', line 23

def children
  @children.values
end

#register_execution(microseconds) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.4.0



27
28
29
# File 'lib/flows/plugin/profiler/report/tree/node.rb', line 27

def register_execution(microseconds)
  @executions << microseconds
end