Sha256: 74c0e82b9c696810500bb3020f87cb3f07bd582852590bad721353bcb1a994b9

Contents?: true

Size: 1004 Bytes

Versions: 6

Compression:

Stored size: 1004 Bytes

Contents

# typed: true
require 'ddtrace/transport/http/api/spec'

module Datadog
  module Profiling
    module Transport
      module HTTP
        module API
          # API specification for profiling
          class Spec < Datadog::Transport::HTTP::API::Spec
            attr_accessor \
              :profiles

            def send_profiling_flush(env, &block)
              raise NoProfilesEndpointDefinedError, self if profiles.nil?

              profiles.call(env, &block)
            end

            def encoder
              profiles.encoder
            end

            # Raised when profiles sent but no profiles endpoint is defined
            class NoProfilesEndpointDefinedError < StandardError
              attr_reader :spec

              def initialize(spec)
                @spec = spec
              end

              def message
                'No profiles endpoint is defined for API specification!'
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ddtrace-1.0.0.beta1 lib/datadog/profiling/transport/http/api/spec.rb
ddtrace-0.54.2 lib/ddtrace/profiling/transport/http/api/spec.rb
ddtrace-0.54.1 lib/ddtrace/profiling/transport/http/api/spec.rb
ddtrace-0.54.0 lib/ddtrace/profiling/transport/http/api/spec.rb
ddtrace-0.53.0 lib/ddtrace/profiling/transport/http/api/spec.rb
ddtrace-0.52.0 lib/ddtrace/profiling/transport/http/api/spec.rb