Sha256: 2b554fc9bac311a8e6458982ee844f4b005cdb523a9ffcfd0cb55dc715ba54b5

Contents?: true

Size: 990 Bytes

Versions: 5

Compression:

Stored size: 990 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.51.1 lib/ddtrace/profiling/transport/http/api/spec.rb
ddtrace-0.51.0 lib/ddtrace/profiling/transport/http/api/spec.rb
ddtrace-0.50.0 lib/ddtrace/profiling/transport/http/api/spec.rb
ddtrace-0.49.0 lib/ddtrace/profiling/transport/http/api/spec.rb
ddtrace-0.48.0 lib/ddtrace/profiling/transport/http/api/spec.rb