Class: RuntimeProfiler::TextReport
- Inherits:
-
Object
- Object
- RuntimeProfiler::TextReport
- Defined in:
- lib/runtime_profiler/text_report.rb
Constant Summary collapse
- COUNT_WIDTH =
5- DURATION_WIDTH =
22- TOTAL_RUNTIME_WIDTH =
20- SUMMARY_TEMPLATE =
<<-EOT.strip_heredoc \e[1mPROFILING REPORT\e[22m ---------------- \e[1mRUNTIME\e[22m Total Runtime : %s ms Database Runtime : %s ms View Runtime : %s ms \e[1mMETHODS\e[22m SLOWEST : %s (%s ms) MOSTLY CALLED : %s (%s number of calls in %s ms) \e[1mSQL CALLS\e[22m Total : %s Total Unique : %s \e[1mSLOWEST\e[22m Total Runtime : %s ms SQL : %s Source : %s \e[1mMOSTLY CALLED\e[22m Total Calls : %s Total Runtime : %s ms SQL : %s Sources : %s EOT
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(json_file, options) ⇒ TextReport
constructor
A new instance of TextReport.
- #print ⇒ Object
Constructor Details
#initialize(json_file, options) ⇒ TextReport
Returns a new instance of TextReport.
44 45 46 47 |
# File 'lib/runtime_profiler/text_report.rb', line 44 def initialize(json_file, ) self.data = JSON.parse( File.read(json_file) ) self. = end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
42 43 44 |
# File 'lib/runtime_profiler/text_report.rb', line 42 def data @data end |
#options ⇒ Object
Returns the value of attribute options.
42 43 44 |
# File 'lib/runtime_profiler/text_report.rb', line 42 def @options end |
Instance Method Details
#print ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/runtime_profiler/text_report.rb', line 49 def print print_summary if self..details == 'full' print_instrumented_methods print_instrumented_sql_calls end end |