Class: Benchin::Wrap::Report::Node::Virtual Private

Inherits:
Benchin::Wrap::Report::Node show all
Defined in:
lib/benchin/wrap/report/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.

Virtual Node is a node without ability to track time in.

It is designed to be used as container for nested nodes.

Instance Attribute Summary

Attributes inherited from Benchin::Wrap::Report::Node

#calls, #name, #nested

Instance Method Summary collapse

Methods inherited from Benchin::Wrap::Report::Node

#add_call, #child_seconds, #initialize

Constructor Details

This class inherits a constructor from Benchin::Wrap::Report::Node

Instance Method Details

#add_timeObject

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.



60
61
62
# File 'lib/benchin/wrap/report/node.rb', line 60

def add_time
  raise 'Cannot add time to a virtual node'
end

#self_secondsObject

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.



56
57
58
# File 'lib/benchin/wrap/report/node.rb', line 56

def self_seconds
  0.0
end

#to_hObject

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.



64
65
66
67
68
69
70
# File 'lib/benchin/wrap/report/node.rb', line 64

def to_h
  {
    name: name,
    total_seconds: total_seconds,
    nested: nested.values.map(&:to_h)
  }
end

#total_secondsObject

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.



52
53
54
# File 'lib/benchin/wrap/report/node.rb', line 52

def total_seconds
  child_seconds
end