Sha256: 4d239872603bf8dbe56fca90a7b1df2e0c04b900ccb70a6d30a8f3b793dfc07d

Contents?: true

Size: 939 Bytes

Versions: 2

Compression:

Stored size: 939 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  class Span
    # @api private
    class Context
      include NaivelyHashable

      def initialize(db: nil, http: nil)
        @db = db && Db.new(db)
        @http = http && Http.new(http)
      end

      attr_accessor :sync, :db, :http

      # @api private
      class Db
        include NaivelyHashable

        def initialize(instance: nil, statement: nil, type: nil, user: nil)
          @instance = instance
          @statement = statement
          @type = type
          @user = user
        end

        attr_accessor :instance, :statement, :type, :user
      end

      # @api private
      class Http
        include NaivelyHashable

        def initialize(url: nil, status_code: nil, method: nil)
          @url = url
          @status_code = status_code
          @method = method
        end

        attr_accessor :url, :status_code, :method
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
elastic-apm-2.0.1 lib/elastic_apm/span/context.rb
elastic-apm-2.0.0 lib/elastic_apm/span/context.rb