Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13 from github/add-histogram
Browse files Browse the repository at this point in the history
Add histogram method
  • Loading branch information
Keith Duncan committed Feb 9, 2015
2 parents 2331219 + 1d28d61 commit c5151c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/statsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ def time(stat, sample_rate=1)
result
end

# Sends a histogram measurement for the given stat to the statsd server. The
# sample_rate determines what percentage of the time this report is sent. The
# statsd server then uses the sample_rate to correctly track the average
# for the stat.
def histogram(stat, value, sample_rate=1); send stat, value, 'h', sample_rate end

private

def sampled(sample_rate)
Expand Down
2 changes: 1 addition & 1 deletion statsd-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Gem::Specification.new do |s|
s.name = %q{statsd-ruby}
s.version = "0.3.0.github.5"
s.version = "0.4.0.github"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Rein Henrichs"]
Expand Down

0 comments on commit c5151c0

Please sign in to comment.