Class: ScoutApm::StackItem

Inherits:
Object
  • Object
show all
Defined in:
lib/scout_apm/stack_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metric_name) ⇒ StackItem

Returns a new instance of StackItem.



6
7
8
9
10
# File 'lib/scout_apm/stack_item.rb', line 6

def initialize(metric_name)
  @metric_name = metric_name
  @start_time = Time.now
  @children_time = 0
end

Instance Attribute Details

#children_timeObject

Returns the value of attribute children_time.



3
4
5
# File 'lib/scout_apm/stack_item.rb', line 3

def children_time
  @children_time
end

#metric_nameObject (readonly)

Returns the value of attribute metric_name.



4
5
6
# File 'lib/scout_apm/stack_item.rb', line 4

def metric_name
  @metric_name
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



4
5
6
# File 'lib/scout_apm/stack_item.rb', line 4

def start_time
  @start_time
end

Instance Method Details

#==(o) ⇒ Object



12
13
14
# File 'lib/scout_apm/stack_item.rb', line 12

def ==(o)
  self.eql?(o)
end

#eql?(o) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/scout_apm/stack_item.rb', line 16

def eql?(o)
  self.class == o.class && metric_name.eql?(o.metric_name)
end