Class: CelluloidBenchmark::TextFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/celluloid_benchmark/text_formatter.rb

Class Method Summary collapse

Class Method Details

.status_text(trans) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/celluloid_benchmark/text_formatter.rb', line 9

def self.status_text(trans)
  if trans.ok?
    "[ OK ]"
  elsif trans.error?
    "[ERR ]"
  else
    "[FAIL]"
  end
end

.to_s(benchmark_run) ⇒ Object



5
6
7
# File 'lib/celluloid_benchmark/text_formatter.rb', line 5

def self.to_s(benchmark_run)
  tp benchmark_run.benchmarks.sort_by(&:label), :label, :threshold, :average_response_time, :min_response_time, :max_response_time, :responses
end