class RSpec::Core::Notifications::ProfileNotification

def calculate_slowest_groups

def calculate_slowest_groups
  # stop if we've only one example group
  return {} if @example_groups.keys.length <= 1
  @example_groups.each_value do |hash|
    hash[:average] = hash[:total_time].to_f / hash[:count]
  end
  groups = @example_groups.sort_by { |_, hash| -hash[:average] }.first(number_of_examples)
  groups.map { |group, data| [group.location, data] }
end