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



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

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



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

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



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

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



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

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



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

def register_execution(microseconds)
  @executions << microseconds
end