Method: Datadog::Statsd#histogram

Defined in:
lib/datadog/statsd.rb

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

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

Examples:

Report the current user count:

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

Parameters:

  • stat (String)

    stat name.

  • value (Numeric)

    histogram value.

  • opts (Hash) (defaults to: EMPTY_OPTIONS)

    the options to create the metric with

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



256
257
258
# File 'lib/datadog/statsd.rb', line 256

def histogram(stat, value, opts = EMPTY_OPTIONS)
  send_stats(stat, value, HISTOGRAM_TYPE, opts)
end