Class: Drnbench::RequestResponse::ProgressiveRunner::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/drnbench/request-response/progressive-runner.rb

Instance Method Summary collapse

Constructor Details

#initializeResult

Returns a new instance of Result.



53
54
55
# File 'lib/drnbench/request-response/progressive-runner.rb', line 53

def initialize
  @results = {}
end

Instance Method Details

#<<(result) ⇒ Object



57
58
59
60
# File 'lib/drnbench/request-response/progressive-runner.rb', line 57

def <<(result)
  @statuses = nil
  @results[result.n_clients] = result
end

#empty?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/drnbench/request-response/progressive-runner.rb', line 62

def empty?
  @results.empty?
end

#statusesObject



66
67
68
# File 'lib/drnbench/request-response/progressive-runner.rb', line 66

def statuses
  @statuses ||= prepare_statuses
end

#to_csvObject



70
71
72
73
74
# File 'lib/drnbench/request-response/progressive-runner.rb', line 70

def to_csv
  ([csv_header] + csv_body).collect do |row|
    CSV.generate_line(row)
  end.join("")
end