Skip to content

Commit

Permalink
Using new MethodMeter.measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
wnuqui committed Feb 14, 2021
1 parent 96466d9 commit da3c8fa
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions lib/runtime_profiler/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,17 @@ def method_calls_data
profiled_methods = {}

# TODO: Group methods under a key and under an object
MethodMeter.measurement.each do |measurement|
measurement.each_pair do |key, data|
data.each do |d|
object = d[:method].split(separator = '.')
object = d[:method].split(separator = '#') if object.length == 1

d[:method] = separator + object.second

if profiled_methods[object.first]
profiled_methods[object.first] << d
else
profiled_methods[object.first] = [d]
end
MethodMeter.measurement.each_pair do |key, data|
data.each do |d|
object = d[:method].split(separator = '.')
object = d[:method].split(separator = '#') if object.length == 1

d[:method] = separator + object.second

if profiled_methods[object.first]
profiled_methods[object.first] << d
else
profiled_methods[object.first] = [d]
end
end
end
Expand Down

0 comments on commit da3c8fa

Please sign in to comment.