Class: Timeasure::Profiling::ReportedMethodsHandler

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

Instance Method Summary collapse

Constructor Details

#initializeReportedMethodsHandler

Returns a new instance of ReportedMethodsHandler.



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

def initialize
  @reported_methods = {}
end

Instance Method Details

#exportObject



15
16
17
# File 'lib/timeasure/profiling/reported_methods_handler.rb', line 15

def export
  @reported_methods.values
end

#report(measurement) ⇒ Object



8
9
10
11
12
13
# File 'lib/timeasure/profiling/reported_methods_handler.rb', line 8

def report(measurement)
  initialize_path_for(measurement) if path_uninitialized_for(measurement)

  @reported_methods[measurement.full_path].increment_runtime_sum(measurement.runtime_in_milliseconds)
  @reported_methods[measurement.full_path].increment_call_count
end