Parent

Included Modules

Stella::Report::Metrics

Public Instance Methods

postprocess() click to toggle source
# File lib/stella/report.rb, line 329
def postprocess
  self.class.field_names.each do |fname|
    next unless self.class.field_types[fname] == Benelux::Stats::Calculator
    hash = send(fname)
    val = Benelux::Stats::Calculator.from_hash hash
    send("#{fname}=", val)
  end
end
process(filter={}) click to toggle source
# File lib/stella/report.rb, line 298
def process(filter={})
  return if processed?
  @response_time = report.timeline.stats.group(:response_time).merge
  @socket_connect = report.timeline.stats.group(:socket_connect).merge
  @first_byte = report.timeline.stats.group(:first_byte).merge
  @send_request = report.timeline.stats.group(:send_request).merge
  @last_byte = report.timeline.stats.group(:last_byte).merge
  #@response_time2 = Benelux::Stats::Calculator.new 
  #@response_time2.sample @socket_connect.mean + @send_request.mean + @first_byte.mean + @last_byte.mean
  @requests = report.timeline.stats.group(:requests).merge.n
  @request_headers_size = Benelux::Stats::Calculator.new 
  @request_content_size = Benelux::Stats::Calculator.new 
  @response_headers_size = Benelux::Stats::Calculator.new 
  @response_content_size = Benelux::Stats::Calculator.new 

  @request_content_size.sample report.content.request_body.size unless report.content.request_body.to_s.empty?
  @response_content_size.sample report.content.response_body.size unless report.content.response_body.to_s.empty?

  @request_headers_size.sample report.headers.request_headers.size unless report.headers.request_headers.to_s.empty?
  @response_headers_size.sample report.headers.response_headers.size unless report.headers.response_headers.to_s.empty?

  # unless report.content.log.empty?
  #   report.content.log.each do |entry|
  #     @request_headers_size.sample entry.request_headers.size if entry.request_headers
  #     @request_content_size.sample entry.request_body.size if entry.request_body
  #     @response_headers_size.sample entry.response_headers.size if entry.response_headers
  #     @response_content_size.sample entry.response_body.size if entry.response_body
  #   end
  # end
  processed!
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.