Sha256: 59eac84ecb37bafdba62d9f0a93cd202df83fe02d2f3e82dbc4d8a7e2ddcfb28

Contents?: true

Size: 1.35 KB

Versions: 21

Compression:

Stored size: 1.35 KB

Contents

require 'elasticsearch/rails/instrumentation/railtie'
require 'elasticsearch/rails/instrumentation/publishers'

module Elasticsearch
  module Rails

    # This module adds support for displaying statistics about search duration in the Rails application log
    # by integrating with the `ActiveSupport::Notifications` framework and `ActionController` logger.
    #
    # == Usage
    #
    # Require the component in your `application.rb` file:
    #
    #     require 'elasticsearch/rails/instrumentation'
    #
    # You should see an output like this in your application log in development environment:
    #
    #     Article Search (321.3ms) { index: "articles", type: "article", body: { query: ... } }
    #
    # Also, the total duration of the request to Elasticsearch is displayed in the Rails request breakdown:
    #
    #     Completed 200 OK in 615ms (Views: 230.9ms | ActiveRecord: 0.0ms | Elasticsearch: 321.3ms)
    #
    # @note The displayed duration includes the HTTP transfer -- the time it took Elasticsearch
    #       to process your request is available in the `response.took` property.
    #
    # @see Elasticsearch::Rails::Instrumentation::Publishers
    # @see Elasticsearch::Rails::Instrumentation::Railtie
    #
    # @see http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html
    #
    #
    module Instrumentation
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
elasticsearch-rails-0.1.0 lib/elasticsearch/rails/instrumentation.rb