Sha256: 9526acbfa064652328a9c53823cc5d91e081ade78750c7478bd796e6a17f245a

Contents?: true

Size: 981 Bytes

Versions: 7

Compression:

Stored size: 981 Bytes

Contents

# typed: true

require_relative '../../../../../ddtrace/transport/http/api/instance'
require_relative 'spec'

module Datadog
  module Profiling
    module Transport
      module HTTP
        module API
          # API instance for profiling
          class Instance < Datadog::Transport::HTTP::API::Instance
            def send_profiling_flush(env)
              raise ProfilesNotSupportedError, spec unless spec.is_a?(Spec)

              spec.send_profiling_flush(env) do |request_env|
                call(request_env)
              end
            end

            # Raised when profiles sent to API that does not support profiles
            class ProfilesNotSupportedError < StandardError
              attr_reader :spec

              def initialize(spec)
                @spec = spec
              end

              def message
                'Profiles not supported for this API!'
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ddtrace-1.5.2 lib/datadog/profiling/transport/http/api/instance.rb
ddtrace-1.5.1 lib/datadog/profiling/transport/http/api/instance.rb
ddtrace-1.5.0 lib/datadog/profiling/transport/http/api/instance.rb
ddtrace-1.4.2 lib/datadog/profiling/transport/http/api/instance.rb
ddtrace-1.4.1 lib/datadog/profiling/transport/http/api/instance.rb
ddtrace-1.4.0 lib/datadog/profiling/transport/http/api/instance.rb
ddtrace-1.3.0 lib/datadog/profiling/transport/http/api/instance.rb