Sha256: cc3e0e36cefbae8ef17887b232ee747a2e42893f9cf9d578e381e3d910b2932e

Contents?: true

Size: 1 KB

Versions: 5

Compression:

Stored size: 1 KB

Contents

module Elasticsearch
  module Rails
    module Instrumentation

      # Rails initializer class to require Elasticsearch::Rails::Instrumentation files,
      # set up Elasticsearch::Model and hook into ActionController to display Elasticsearch-related duration
      #
      # @see http://edgeguides.rubyonrails.org/active_support_instrumentation.html
      #
      class Railtie < ::Rails::Railtie
        initializer "elasticsearch.instrumentation" do |app|
          require 'elasticsearch/rails/instrumentation/log_subscriber'
          require 'elasticsearch/rails/instrumentation/controller_runtime'

          Elasticsearch::Model::Searching::SearchRequest.class_eval do
            include Elasticsearch::Rails::Instrumentation::Publishers::SearchRequest
          end if defined?(Elasticsearch::Model::Searching::SearchRequest)

          ActiveSupport.on_load(:action_controller) do
            include Elasticsearch::Rails::Instrumentation::ControllerRuntime
          end
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
elasticsearch-rails-6.1.2 lib/elasticsearch/rails/instrumentation/railtie.rb
elasticsearch-rails-6.1.1 lib/elasticsearch/rails/instrumentation/railtie.rb
elasticsearch-rails-6.1.0 lib/elasticsearch/rails/instrumentation/railtie.rb
elasticsearch-rails-6.0.0 lib/elasticsearch/rails/instrumentation/railtie.rb
elasticsearch-rails-6.0.0.pre lib/elasticsearch/rails/instrumentation/railtie.rb