Class: Timeasure::Profiling::ReportedMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/timeasure/profiling/reported_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(measurement) ⇒ ReportedMethod

Returns a new instance of ReportedMethod.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/timeasure/profiling/reported_method.rb', line 6

def initialize(measurement)
  @klass_name = measurement.klass_name
  @method_name = measurement.method_name
  @segment = measurement.segment
  @metadata = measurement.
  @full_path = measurement.full_path
  @method_path = measurement.method_path

  @runtime_sum = 0
  @call_count = 0
end

Instance Attribute Details

#call_countObject (readonly)

Returns the value of attribute call_count.



4
5
6
# File 'lib/timeasure/profiling/reported_method.rb', line 4

def call_count
  @call_count
end

#full_pathObject (readonly)

Returns the value of attribute full_path.



4
5
6
# File 'lib/timeasure/profiling/reported_method.rb', line 4

def full_path
  @full_path
end

#klass_nameObject (readonly)

Returns the value of attribute klass_name.



4
5
6
# File 'lib/timeasure/profiling/reported_method.rb', line 4

def klass_name
  @klass_name
end

#metadataObject (readonly)

Returns the value of attribute metadata.



4
5
6
# File 'lib/timeasure/profiling/reported_method.rb', line 4

def 
  @metadata
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



4
5
6
# File 'lib/timeasure/profiling/reported_method.rb', line 4

def method_name
  @method_name
end

#method_pathObject (readonly)

Returns the value of attribute method_path.



4
5
6
# File 'lib/timeasure/profiling/reported_method.rb', line 4

def method_path
  @method_path
end

#runtime_sumObject (readonly)

Returns the value of attribute runtime_sum.



4
5
6
# File 'lib/timeasure/profiling/reported_method.rb', line 4

def runtime_sum
  @runtime_sum
end

#segmentObject (readonly)

Returns the value of attribute segment.



4
5
6
# File 'lib/timeasure/profiling/reported_method.rb', line 4

def segment
  @segment
end

Instance Method Details

#increment_call_countObject



22
23
24
# File 'lib/timeasure/profiling/reported_method.rb', line 22

def increment_call_count
  @call_count += 1
end

#increment_runtime_sum(runtime) ⇒ Object



18
19
20
# File 'lib/timeasure/profiling/reported_method.rb', line 18

def increment_runtime_sum(runtime)
  @runtime_sum += runtime
end