Sha256: f291984cc1b8954572239452108c5a90ef248f1674a49c3e137c51f2167dfe5f

Contents?: true

Size: 859 Bytes

Versions: 5

Compression:

Stored size: 859 Bytes

Contents

begin 
  require 'rubygems'
  require 'gchart'
rescue LoadError
  $stderr.puts "The FancyHTML output format requires the googlechart gem:"
  $stderr.puts "  (sudo) gem install googlecharts"
end

module RequestLogAnalyzer::Output
  
  class FancyHTML < HTML
    
    # Load class files if needed
    def self.const_missing(const)
      RequestLogAnalyzer::load_default_class_file(self, const)
    end
    
    def report_tracker(tracker)
      case tracker
      when RequestLogAnalyzer::Tracker::HourlySpread then report_hourly_spread(tracker)
      else tracker.report(self)
      end
    end
    
    def report_hourly_spread(tracker)
      title tracker.title
      puts tag(:img, nil, :width => '700', :height => '120', :src =>
          Gchart.sparkline(:data => tracker.hour_frequencies, :size => '700x120', :line_colors => '0077CC'))
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
request-log-analyzer-1.6.2 lib/request_log_analyzer/output/fancy_html.rb
request-log-analyzer-1.6.1 lib/request_log_analyzer/output/fancy_html.rb
request-log-analyzer-1.6.0 lib/request_log_analyzer/output/fancy_html.rb
request-log-analyzer-1.5.4 lib/request_log_analyzer/output/fancy_html.rb
request-log-analyzer-1.5.3 lib/request_log_analyzer/output/fancy_html.rb