Permalink
Browse files

add set support

  • Loading branch information...
1 parent 25f4bee commit d7d016a9330aef0a720d9e5eac6ddd0f438ddd23 @disaacs disaacs committed Feb 5, 2014
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/statsd/instrument.rb
View
@@ -156,6 +156,11 @@ def self.histogram(key, value, sample_rate_or_epoch = default_sample_rate, tags
collect(key, value, :h, sample_rate_or_epoch, tags)
end
+ # uniques:765|s
+ def self.set(key, value, sample_rate_or_epoch = default_sample_rate, tags = nil)
+ collect(key, value, :s, sample_rate_or_epoch, tags)
+ end
+
private
def self.invalidate_socket
@@ -209,6 +214,8 @@ def self.generate_packet(k, v, op, sample_rate = default_sample_rate, tags = nil
when :h
raise NotImplementedError, "Histograms only supported on DataDog implementation." unless self.implementation == :datadog
command << '|h'
+ when :s
+ command << '|s'
end
command << "|@#{sample_rate}" if sample_rate < 1 || (self.implementation == :statsite && sample_rate > 1)

0 comments on commit d7d016a

Please sign in to comment.