Class: Drnbench::Reporters::ThroughputReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/drnbench/reporters/throughput-reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(label) ⇒ ThroughputReporter

Returns a new instance of ThroughputReporter.


24
25
26
27
# File 'lib/drnbench/reporters/throughput-reporter.rb', line 24

def initialize(label)
  @label = label
  @data_file = Tempfile.new("drnbench-throughput-data")
end

Instance Method Details

#add_data(time, qps) ⇒ Object


29
30
31
# File 'lib/drnbench/reporters/throughput-reporter.rb', line 29

def add_data(time, qps)
  @data_file.puts([time, qps].join("\t"))
end

#report(output_directory) ⇒ Object


33
34
35
36
# File 'lib/drnbench/reporters/throughput-reporter.rb', line 33

def report(output_directory)
  FileUtils.mkdir_p(output_directory)
  generate_chart(output_directory)
end