Class: JmeterReports::Views::AsciiSummaryList
- Inherits:
-
Object
- Object
- JmeterReports::Views::AsciiSummaryList
- Defined in:
- lib/jmeter/reports/views/ascii_summary_list.rb
Constant Summary collapse
- HEADERS =
[:filename,:start,:end,:samples,:avg_thrput]
Instance Method Summary collapse
-
#initialize(files) ⇒ AsciiSummaryList
constructor
A new instance of AsciiSummaryList.
- #render ⇒ Object
- #report_data(color = true) ⇒ Object
Constructor Details
#initialize(files) ⇒ AsciiSummaryList
Returns a new instance of AsciiSummaryList.
6 7 8 |
# File 'lib/jmeter/reports/views/ascii_summary_list.rb', line 6 def initialize(files) @files = files end |
Instance Method Details
#render ⇒ Object
25 26 27 |
# File 'lib/jmeter/reports/views/ascii_summary_list.rb', line 25 def render Formatador.display_compact_table(report_data, HEADERS) end |
#report_data(color = true) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/jmeter/reports/views/ascii_summary_list.rb', line 10 def report_data(color = true) data = [] @files.each do |filename| r = JmeterReports::Summary.create(filename) data << { :filename => (color ? "[yellow]#{File.basename(filename)}[/]" : File.basename(filename)), :start => r.start_date, :end => r.end_date, :samples => (color ? "[blue]#{r.total_requests}[/]" : r.total_requests), :avg_thrput => "#{r.avg_throughput} RPS" } end return data end |