Sha256: b414ecd868b72da9b341db26290f7c0d6632aa3f8a02089aee6a6f1a4a6aaa40

Contents?: true

Size: 984 Bytes

Versions: 5

Compression:

Stored size: 984 Bytes

Contents

# typed: true
require 'ddtrace/transport/http/api/instance'
require 'ddtrace/profiling/transport/http/api/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

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.54.2 lib/ddtrace/profiling/transport/http/api/instance.rb
ddtrace-0.54.1 lib/ddtrace/profiling/transport/http/api/instance.rb
ddtrace-0.54.0 lib/ddtrace/profiling/transport/http/api/instance.rb
ddtrace-0.53.0 lib/ddtrace/profiling/transport/http/api/instance.rb
ddtrace-0.52.0 lib/ddtrace/profiling/transport/http/api/instance.rb