Sha256: bf46f9c69e10f287c405a1fc0c70f471771f29558f62dc2062a51c1fff6b9014
Contents?: true
Size: 1.22 KB
Versions: 6
Compression:
Stored size: 1.22 KB
Contents
#!/usr/bin/env ruby require File.join(File.dirname(__FILE__), '..', 'lib', 'slow_actions') opts = {} start_date = ARGV.detect{|arg| arg =~/--start-date=(\S+)/} opts[:start_date] = $1 if start_date end_date = ARGV.detect{|arg| arg =~/--end-date=(\S+)/} opts[:end_date] = $1 if start_date @sa = SlowActions.new(opts) ARGV.select{|arg| arg[0,2] != "--"}.each do |file| @sa.parse_file(file) end opts = {} mincost = ARGV.detect{|arg| arg =~ /--min-cost=(\S+)/ } opts[:mincost] = $1.to_f if mincost minavg = ARGV.detect{|arg| arg =~ /--min-avg=(\S+)/ } opts[:minavg] = $1.to_f if minavg minmax = ARGV.detect{|arg| arg =~ /--min-max=(\S+)/ } opts[:minmax] = $1.to_f if minmax output = [] if (ARGV.include? "--actions") output << @sa.print_actions(opts) end if (ARGV.include? "--controllers") output << @sa.print_controller_tree(opts) end if (ARGV.include? "--sessions") output << @sa.print_sessions(opts) end if output.size == 0 puts "Usage: slow-actions (--actions | --controllers | --sessions) log_file [log_file ...]" puts "You may also specify:" puts "\t--min-cost=FLOAT" puts "\t--min-avg=FLOAT" puts "\t--min-max=FLOAT" puts "\t--start-date=YYYY-MM-DD" puts "\t--end-date=YYYY-MM-DD" else puts output.join("\n\n") end
Version data entries
6 entries across 6 versions & 2 rubygems