<commit_before>= rack-couchlogger

rack-couchlogger is Rack middleware that stores the environment for every 
incoming request, as well as the duration of the request and request time
in CouchDB. It also provides basic ability to query that data. Your config.ru
should looks something like:

    require 'rubygems'
    require 'couch_logger'
    
    use Rack::CouchLogger
    run lambda { [200, {"Content-Type" => "text/plain"}, ["Hello world!"]] }

You can query your log by using the following methods:

    Log.by_created_at

returns all log events by the date/time they were created.

    Log.by_path_info_times(:raw => true, :reduce => true, :group => true)["rows"].each do |r| 
      puts "#{r["key"]} takes #{r["value"]} seconds on average"
    end

returns all the paths that have been requested and their average duration.

== Source

http://github.com/cpetersen/rack-couchlogger

== Copyright

Copyright (c) 2009 <NAME>. See LICENSE for details.<commit_msg>Updated the example query<commit_after>= rack-couchlogger

rack-couchlogger is Rack middleware that stores the environment for every 
incoming request, as well as the duration of the request and request time
in CouchDB. It also provides basic ability to query that data. Your config.ru
should looks something like:

    require 'rubygems'
    require 'couch_logger'
    
    use Rack::CouchLogger
    run lambda { [200, {"Content-Type" => "text/plain"}, ["Hello world!"]] }

You can query your log by using the following methods:

    Log.by_created_at

returns all log events by the date/time they were created.

    Log.by_path_info_times(:raw => true, :reduce => true, :group => true)["rows"].each do |r| 
      puts "#{r["key"]} takes #{r["value"]} seconds on average"
    end

returns all the paths that have been requested and their average duration:

    / takes 0.00101852675953079 seconds on average
    /favicon.ico takes 0.000547599665421724 seconds on average

== Source

http://github.com/cpetersen/rack-couchlogger

== Copyright

Copyright (c) 2009 <NAME>. See LICENSE for details.
{'fraction_non_alphanumeric': 0.09646146388754241, 'fraction_numerical': 0.024721279689772176, 'mean_word_length': 3.9260143198090693, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '443889', 'n_tokens_mistral': 644, 'n_tokens_neox': 596, 'n_words': 243}