Method: Datadog::Statsd#distribution

Defined in:
lib/datadog/statsd.rb

#distribution(stat, value, opts = EMPTY_OPTIONS) ⇒ Object

Sends a value to be tracked as a distribution to the statsd server.

Examples:

Report the current user count:

$statsd.distribution('user.count', User.count)

Options Hash (opts):

  • :sample_rate (Numeric)

    sample rate, 1 for always

  • :pre_sampled (Boolean)

    If true, the client assumes the caller has already sampled metrics at :sample_rate, and doesn’t perform sampling.

  • :tags (Array<String>)

    An array of tags

  • :cardinality (String)

    The tag cardinality to use

Parameters:

  • stat name.

  • distribution value.

  • (defaults to: EMPTY_OPTIONS)

    the options to create the metric with



271
272
273
# File 'lib/datadog/statsd.rb', line 271

def distribution(stat, value, opts = EMPTY_OPTIONS)
  send_stats(stat, value, DISTRIBUTION_TYPE, opts)
end