Class: Datadog::Tracing::Sampling::RateLimiter

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/tracing/sampling/rate_limiter.rb

Overview

Checks for rate limiting on a resource.

Direct Known Subclasses

TokenBucket, UnlimitedLimiter

Instance Method Summary collapse

Instance Method Details

#allow?(size) ⇒ Boolean

Checks if resource of specified size can be conforms with the current limit.

Implementations of this method are not guaranteed to be side-effect free.

Returns:

  • (Boolean)

    whether a resource conforms with the current limit



16
# File 'lib/datadog/tracing/sampling/rate_limiter.rb', line 16

def allow?(size); end

#effective_rateFloat

The effective rate limiting ratio based on recent calls to allow?.

Returns:

  • (Float)

    recent allowance ratio



22
# File 'lib/datadog/tracing/sampling/rate_limiter.rb', line 22

def effective_rate; end