Class: Redu::Analyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/redu/analyzer.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Analyzer

Returns a new instance of Analyzer.



87
88
89
90
91
92
# File 'lib/redu/analyzer.rb', line 87

def initialize(options)
  @redis = Redis.new(options)
  @delimiter = options[:delimiter]
  @prefixes = {}
  @worst_offender_set = WorstOffenderSet.new(options[:worst_offender_count])
end

Instance Method Details

#startObject



94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/redu/analyzer.rb', line 94

def start
  keys = []
  STDERR.puts "Loading Keys for Analysis. This may take a few minutes"
  keys = @redis.keys
  pb = ProgressBar.new("Analyzing",keys.size)
  keys.each do |key|
    analyze_key(key)
    pb.inc
  end
  pb.finish

  output_prefix_table
  output_worst_offenders_table
end