Sha256: 1c6b9641ae4ac8611bfd055e62a402c5f7b0388d3da63ad02c9036b2c2dfed62

Contents?: true

Size: 1.09 KB

Versions: 18

Compression:

Stored size: 1.09 KB

Contents

# Copyright (c) 2015 AppNeta, Inc.
# All rights reserved.

module TraceView
  module Inst
    module RestClientRequest
      def self.included(klass)
        ::TraceView::Util.method_alias(klass, :execute, ::RestClient::Request)
      end

      ##
      # execute_with_traceview
      #
      # The wrapper method for RestClient::Request.execute
      #
      def execute_with_traceview & block
        kvs = {}
        kvs['Backtrace'] = TraceView::API.backtrace if TraceView::Config[:rest_client][:collect_backtraces]
        TraceView::API.log_entry('rest-client', kvs)

        # The core rest-client call
        execute_without_traceview(&block)
      rescue => e
        TraceView::API.log_exception('rest-client', e)
        raise e
      ensure
        TraceView::API.log_exit('rest-client')
      end
    end
  end
end

if TraceView::Config[:rest_client][:enabled]
  if defined?(::RestClient)
    TraceView.logger.info '[traceview/loading] Instrumenting rest-client' if TraceView::Config[:verbose]
    ::TraceView::Util.send_include(::RestClient::Request, ::TraceView::Inst::RestClientRequest)
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
traceview-3.8.0-java lib/traceview/inst/rest-client.rb
traceview-3.8.0 lib/traceview/inst/rest-client.rb
traceview-3.7.1-java lib/traceview/inst/rest-client.rb
traceview-3.7.1 lib/traceview/inst/rest-client.rb
traceview-3.7.0-java lib/traceview/inst/rest-client.rb
traceview-3.7.0 lib/traceview/inst/rest-client.rb
traceview-3.6.0-java lib/traceview/inst/rest-client.rb
traceview-3.6.0 lib/traceview/inst/rest-client.rb
traceview-3.5.1-java lib/traceview/inst/rest-client.rb
traceview-3.5.1 lib/traceview/inst/rest-client.rb
traceview-3.5.0-java lib/traceview/inst/rest-client.rb
traceview-3.5.0 lib/traceview/inst/rest-client.rb
traceview-3.4.2-java lib/traceview/inst/rest-client.rb
traceview-3.4.2 lib/traceview/inst/rest-client.rb
traceview-3.4.1-java lib/traceview/inst/rest-client.rb
traceview-3.4.1 lib/traceview/inst/rest-client.rb
traceview-3.4.0-java lib/traceview/inst/rest-client.rb
traceview-3.4.0 lib/traceview/inst/rest-client.rb