lib/tasks/analysis/smallog.rake
# Count how many rows are for a class of status codes (eg, 2xx)
Count how many rows are for a class of status codes
Count how many rows are for a class of status codes
def percentage_status_code(rows, number)
  count = rows.select {|row| row[4].start_with?(number.to_s) }.size
  percentage = count / rows.size.to_f
  (percentage * 100).round.to_s + '%'
end
def percentage_status_code ( rows , number ) count = rows . select { | row | row [ 4 ] . start_with? ( number . to_s ) } . size percentage = count / rows . size . to_f ( percentage * 100 ) . round . to_s + '%' end
Count how many rows are for a class of status codes (eg, 2xx)
Count how many rows are for a class of status codes ( eg 2xx )
rows
<not_specific>
number
<not_specific>