Permalink
Browse files

Refactor Statsd#increment and #decrement to use #count

  • Loading branch information...
Rein Henrichs
Rein Henrichs committed Feb 19, 2011
1 parent 6992f7d commit 9700de487eb2f1730f3b67da835ba669b81f1e9a
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/statsd.rb
View
@@ -5,11 +5,15 @@ def initialize(host, port)
end
def increment(stat)
- socket.send("#{stat}:1|c")
+ count stat, 1
end
def decrement(stat)
- socket.send("#{stat}:-1|c")
+ count stat, -1
+ end
+
+ def count(stat, count)
+ socket.send("#{stat}:#{count}|c")
end
private

0 comments on commit 9700de4

Please sign in to comment.