Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Save another per-stat string allocation
  • Loading branch information
jeremy committed Dec 4, 2011
1 parent a551ba2 commit b6eb3d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/statsd.rb
Expand Up @@ -65,7 +65,7 @@ def decrement(stat, sample_rate=1)
# @param [Integer] count count # @param [Integer] count count
# @param [Numeric] sample_rate sample rate, 1 for always # @param [Numeric] sample_rate sample rate, 1 for always
def count(stat, count, sample_rate=1) def count(stat, count, sample_rate=1)
send_stats stat, count, 'c', sample_rate send_stats stat, count, :c, sample_rate
end end


# Sends an arbitary gauge value for the given stat to the statsd server. # Sends an arbitary gauge value for the given stat to the statsd server.
Expand All @@ -80,7 +80,7 @@ def count(stat, count, sample_rate=1)
# @example Report the current user count: # @example Report the current user count:
# $statsd.gauge('user.count', User.count) # $statsd.gauge('user.count', User.count)
def gauge(stat, value, sample_rate=1) def gauge(stat, value, sample_rate=1)
send_stats stat, value, 'g', sample_rate send_stats stat, value, :g, sample_rate
end end


# Sends a timing (in ms) for the given stat to the statsd server. The # Sends a timing (in ms) for the given stat to the statsd server. The
Expand All @@ -92,7 +92,7 @@ def gauge(stat, value, sample_rate=1)
# @param [Integer] ms timing in milliseconds # @param [Integer] ms timing in milliseconds
# @param [Numeric] sample_rate sample rate, 1 for always # @param [Numeric] sample_rate sample rate, 1 for always
def timing(stat, ms, sample_rate=1) def timing(stat, ms, sample_rate=1)
send_stats stat, ms, 'ms', sample_rate send_stats stat, ms, :ms, sample_rate
end end


# Reports execution time of the provided block using {#timing}. # Reports execution time of the provided block using {#timing}.
Expand Down

0 comments on commit b6eb3d8

Please sign in to comment.