Class: Flows::Plugin::Profiler::Report::Flat

Inherits:
Tree show all
Defined in:
lib/flows/plugin/profiler/report/flat.rb,
lib/flows/plugin/profiler/report/flat/method_report.rb

Overview

Flat report. Merges similar calls, hides execution structure.

It's a variation of a Rport::Tree where all calls of the same method are combined into a one first-level entry.

Examples:

Flows::Plugin::Profiler.profile(:flat) do
  # some code here
end

puts Flows::Plugin::Profiler.last_report

Since:

  • 0.4.0

Defined Under Namespace

Classes: MethodReport

Instance Attribute Summary

Attributes inherited from Flows::Plugin::Profiler::Report

#raw_data

Instance Method Summary collapse

Methods inherited from Tree

#add

Methods inherited from Flows::Plugin::Profiler::Report

#add, #events, #initialize

Constructor Details

This class inherits a constructor from Flows::Plugin::Profiler::Report

Instance Method Details

#to_aObject

Since:

  • 0.4.0



19
20
21
# File 'lib/flows/plugin/profiler/report/flat.rb', line 19

def to_a
  method_reports.map(&:to_h)
end

#to_sObject

Since:

  • 0.4.0



23
24
25
# File 'lib/flows/plugin/profiler/report/flat.rb', line 23

def to_s
  method_reports.map(&:to_s).join("\n")
end