Module: Cuboid::Support::Mixins::Profiler::ClassMethods

Defined in:
lib/cuboid/support/mixins/profiler.rb

Instance Method Summary collapse

Instance Method Details

#profile_dataObject



45
46
47
# File 'lib/cuboid/support/mixins/profiler.rb', line 45

def profile_data
    @profile ||= {}
end

#profile_data_avgObject



49
50
51
# File 'lib/cuboid/support/mixins/profiler.rb', line 49

def profile_data_avg
    ::Hash[self.profile_data.sort_by { |_, d| d[:avg] }.reverse]
end

#profile_data_totalObject



53
54
55
# File 'lib/cuboid/support/mixins/profiler.rb', line 53

def profile_data_total
    ::Hash[self.profile_data.sort_by { |_, d| d[:total] }.reverse]
end