class Dynowatch::CLI
Constants
- LOG_DATA
Your code goes hereā¦
- VALID_RESOURCE
Public Class Methods
print_data()
click to toggle source
# File lib/dynowatch.rb, line 39 def self.print_data parser = Dynowatch::Parser analyzer = Dynowatch::Analyzer file_path = ARGV[0] log_file_info = parser.parse_log_file(file_path, VALID_RESOURCE, LOG_DATA) results = log_file_info[VALID_RESOURCE.to_sym] results.each_pair do |url_name, url_info| puts "======================== #{url_info[:path]} ================================" puts "Number of calls: #{url_info[:count]}" puts "Mean response time: #{analyzer.mean(url_info[:times])}ms" puts "Median response time: #{analyzer.median(url_info[:times])}ms" puts "Mode response time: #{analyzer.mode(url_info[:times])}ms" puts "Dyno that responded the most: #{analyzer.mode(url_info[:dynos])}" end end