Class: SentrySmartSampler

Inherits:
Object
  • Object
show all
Defined in:
lib/sentry_smart_sampler.rb,
lib/sentry_smart_sampler/sampler.rb,
lib/sentry_smart_sampler/rate_limit.rb,
lib/sentry_smart_sampler/configuration.rb,
lib/sentry_smart_sampler/throttling_per_error_registry.rb,
lib/sentry_smart_sampler/sample_rate_per_error_registry.rb,
lib/sentry_smart_sampler/throttling_threshold_reached_definition.rb

Defined Under Namespace

Classes: Configuration, RateLimit, SampleRatePerErrorRegistry, Sampler, ThrottlingPerErrorRegistry, ThrottlingThresholdReachedDefinition

Class Method Summary collapse

Class Method Details

.call(event, hint) ⇒ Object



28
29
30
# File 'lib/sentry_smart_sampler.rb', line 28

def self.call(event, hint)
  SentrySmartSampler::Sampler.new(self).call(event, hint)
end

.configurationObject



12
13
14
# File 'lib/sentry_smart_sampler.rb', line 12

def self.configuration
  @configuration ||= SentrySmartSampler::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



16
17
18
# File 'lib/sentry_smart_sampler.rb', line 16

def self.configure
  yield configuration
end

.reset!Object



32
33
34
# File 'lib/sentry_smart_sampler.rb', line 32

def self.reset!
  @configuration = nil
end

.sample_rate_registration_for(error) ⇒ Object



20
21
22
# File 'lib/sentry_smart_sampler.rb', line 20

def self.sample_rate_registration_for(error)
  configuration.sampling_rate_per_error_registry.sample_rate_registration_for(error)
end

.throttling_registration_for(error) ⇒ Object



24
25
26
# File 'lib/sentry_smart_sampler.rb', line 24

def self.throttling_registration_for(error)
  configuration.throttling_per_error_registry.throttling_registration_for(error)
end