Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/datadog/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ module Core
rescue LoadError => e
e.message
end

module_function def ddsketch_supported?
LIBDATADOG_API_FAILURE.nil?
end
end

DATADOG_ENV = Core::Configuration::ConfigHelper.new
Expand Down
19 changes: 0 additions & 19 deletions lib/datadog/core/ddsketch.rb

This file was deleted.

3 changes: 1 addition & 2 deletions lib/datadog/data_streams/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
require_relative '../version'
require_relative '../core/worker'
require_relative '../core/workers/polling'
require_relative '../core/ddsketch'
require_relative '../core/buffer/cruby'
require_relative '../core/utils/time'

Expand Down Expand Up @@ -39,7 +38,7 @@ class Processor < Core::Worker
# (default: DEFAULT_BUFFER_SIZE). Higher values support more throughput but use more memory.
# @raise [UnsupportedError] if DDSketch is not available on this platform
def initialize(interval:, logger:, settings:, agent_settings:, buffer_size: DEFAULT_BUFFER_SIZE)
raise UnsupportedError, 'DDSketch is not supported' unless Datadog::Core::DDSketch.supported?
raise UnsupportedError, 'DDSketch is not supported' unless Datadog::Core.ddsketch_supported?

@settings = settings
@agent_settings = agent_settings
Expand Down
2 changes: 0 additions & 2 deletions sig/datadog/core/ddsketch.rbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module Datadog
module Core
class DDSketch
def self.supported?: () -> bool

# Adds a single point to the sketch
# @param point [::Numeric] The value to add to the sketch
# @return [true] Always returns true on success, raises RuntimeError on failure
Expand Down
12 changes: 0 additions & 12 deletions spec/datadog/core/ddsketch_spec.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
require 'datadog/core'
require 'datadog/core/ddsketch'
require 'datadog/core/ddsketch_pprof/ddsketch_pb'

RSpec.describe Datadog::Core::DDSketch do
context 'when DDSketch is not supported' do
before do
stub_const('Datadog::Core::LIBDATADOG_API_FAILURE', 'Example error loading libdatadog_api')
end

it 'raises an error' do
expect { described_class.new }.to raise_error(ArgumentError, 'DDSketch is not supported: Example error loading libdatadog_api')
end
end

context 'when DDSketch is supported' do
subject(:sketch) { described_class.new }

Expand Down
2 changes: 0 additions & 2 deletions spec/datadog/data_streams/processor_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

require 'datadog/core'
require 'datadog/data_streams/processor'
require 'datadog/core/ddsketch'
require_relative 'spec_helper'

# Expected deterministic hash values for specific pathways (with manual_checkpoint: false)
Expand Down
2 changes: 1 addition & 1 deletion spec/datadog/data_streams/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def skip_if_data_streams_not_supported(testcase)
)
end

return if Datadog::Core::DDSketch.supported?
return if Datadog::Core.ddsketch_supported?

# Ensure DDSketch was loaded correctly
raise "DDSketch does not seem to be available: #{Datadog::Core::LIBDATADOG_API_FAILURE}. " \
Expand Down
2 changes: 0 additions & 2 deletions spec/datadog/tracing/contrib/kafka/data_streams_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

require 'datadog/tracing/contrib/support/spec_helper'
require 'datadog/core'
require 'datadog/core/ddsketch'
require 'datadog/data_streams/spec_helper'
require 'ostruct'
require 'datadog/tracing/contrib/kafka/integration'
Expand Down
2 changes: 0 additions & 2 deletions spec/datadog/tracing/contrib/karafka/data_streams_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

require 'datadog/tracing/contrib/support/spec_helper'
require 'datadog/core'
require 'datadog/core/ddsketch'
require 'datadog/data_streams/spec_helper'
require 'karafka'
require 'ostruct'
Expand Down
Loading