Class: RequestLog::Objects

### Home Classes Methods

### In Files

- lib/mongrel/debug.rb

### Parent

GemPlugin::Plugin"/handlers"

### Methods

- #process

### Included Modules

- Mongrel::HttpHandlerPlugin

### Files

- CHANGELOG
- COPYING
- LICENSE
- README
- Makefile

### Class/Module Index

Quicksearch

- Mongrel
- Mongrel::CGIWrapper
- Mongrel::Camping
- Mongrel::Camping::CampingHandler
- Mongrel::Command
- Mongrel::Command::Base
- Mongrel::Command::Registry
- Mongrel::Configurator
- Mongrel::Const
- Mongrel::DeflateFilter
- Mongrel::DirHandler
- Mongrel::Error404Handler
- Mongrel::Gems
- Mongrel::HeaderOut
- Mongrel::HttpHandler
- Mongrel::HttpHandlerPlugin
- Mongrel::HttpParams
- Mongrel::HttpParser
- Mongrel::HttpParserError
- Mongrel::HttpRequest
- Mongrel::HttpResponse
- Mongrel::HttpServer
- Mongrel::Rails
- Mongrel::Rails::RailsConfigurator
- Mongrel::Rails::RailsHandler
- Mongrel::RedirectHandler
- Mongrel::StatisticsFilter
- Mongrel::Stats
- Mongrel::StatusHandler
- Mongrel::StopServer
- Mongrel::TimeoutError
- Mongrel::URIClassifier
- Mongrel::URIClassifier::RegistrationError
- Mongrel::URIClassifier::UsageError
- RequestLog
- RequestLog::Access
- RequestLog::Files
- RequestLog::Objects
- RequestLog::Params
- RequestLog::Threads
- IO
- Kernel
- MongrelDbg
- TCPServer

No matching classes.

# RequestLog::Objects

stolen from Robert Klemme

### Public Instance Methods

process(request,response) click to toggle source

    # File lib/mongrel/debug.rb, line 121
    def process(request,response)
      begin
        stats = Hash.new(0)
        lengths = {}
        begin
          ObjectSpace.each_object do |o|
            begin
              if o.respond_to? :length
                len = o.length
                lengths[o.class] ||= Mongrel::Stats.new(o.class)
                lengths[o.class].sample(len)
              end
            rescue Object
            end

            stats[o.class] += 1
          end
        rescue Object # Ignore since ObjectSpace might not be loaded on JRuby
        end

        stats.sort {|(k1,v1),(k2,v2)| v2 <=> v1}.each do |k,v|
          if $last_stat
            delta = v - $last_stat[k]
            if v > 10 and delta != 0
              if lengths[k]
                $objects_out.printf "%d,%s,%d,%d,%d,%f,%f,%f\n", $run_count, k, $last_stat[k], v, delta,lengths[k].mean,lengths[k].sd,lengths[k].max
              else
                $objects_out.printf "%d,%s,%d,%d,%d,,,\n", $run_count, k, $last_stat[k], v, delta
              end
            end
          end
        end

        $run_count += 1
        $last_stat = stats
      rescue Object
        STDERR.puts "object.log ERROR: #$!"
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.