Method: Statsd#gauge

Defined in:
lib/statsd.rb

#gauge(stat, value, sample_rate = 1) ⇒ Object

Sends an arbitary gauge value for the given stat to the statsd server.

This is useful for recording things like available disk space, memory usage, and the like, which have different semantics than counters.

Examples:

Report the current user count:

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

Parameters:

  • stat (String)

    stat name.

  • value (Numeric)

    gauge value.

  • sample_rate (Numeric) (defaults to: 1)

    sample rate, 1 for always



384
385
386
# File 'lib/statsd.rb', line 384

def gauge(stat, value, sample_rate=1)
  send_stats stat, value, :g, sample_rate
end