lib/opencensus/trace/samplers.rb in opencensus-0.3.1 vs lib/opencensus/trace/samplers.rb in opencensus-0.4.0

- old
+ new

@@ -10,36 +10,40 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + require "opencensus/trace/samplers/always_sample" require "opencensus/trace/samplers/never_sample" require "opencensus/trace/samplers/probability" -require "opencensus/trace/samplers/max_qps" +require "opencensus/trace/samplers/rate_limiting" module OpenCensus module Trace ## # A sampler determines whether a given request's latency trace should # actually be reported. It is usually not necessary to trace every # request, especially for an application serving heavy traffic. You may # use a sampler to decide, for a given request, whether to report its # trace. # - # The OpenCensus specification defines three samplers: AlwaysSample, - # NeverSample, and Probability. The Ruby implementation also provides a - # fourth, MaxQPS, based on the Stackdriver library. + # The OpenCensus specification defines four samplers: + # {OpenCensus::Trace::Samplers::AlwaysSample}, + # {OpenCensus::Trace::Samplers::NeverSample}, + # {OpenCensus::Trace::Samplers::Probability}, and + # {OpenCensus::Trace::Samplers::RateLimiting}. # - # A sampler is a Proc that takes a hash of environment information and + # A sampler is a `Proc` that takes a hash of environment information and # returns a boolean indicating whether or not to sample the current - # request. Alternately, it could be an object that duck-types the Proc + # request. Alternately, it could be an object that duck-types the `Proc` # interface by implementing the `call` method. The hash passed to `call` # may contain the following keys, all of which are optional. Samplers must # adjust their behavior to account for the availability or absence of any # environment information: # - # * `span_context` The SpanContext that created the span being sampled. + # * `span_context` The {OpenCensus::Trace::SpanContext} that created the + # span being sampled. # * `rack_env` The hash of Rack environment information # # Applications may set a default sampler in the config. In addition, the # sampler may be overridden whenever a span is created. #