Browse files

Update read me with block about lambdas as metric names

  • Loading branch information...
1 parent cb82485 commit 125526a0f0c76573db792611929e6f8491913904 @himynameisjonas himynameisjonas committed Oct 6, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0
@@ -136,6 +136,14 @@ AWS::S3::Base.singleton_class.extend StatsD::Instrument
AWS::S3::Base.singleton_class.statsd_measure :request, 'S3.request'
+### Lambda As Metric Name
+Send a lambda instead of a string as the metric name to dynamically set the name of the metric. Useful when measuring sub classes.
+``` ruby
+GoogleBase.statsd_count :insert, lamdba{|object| object.class.to_s.downcase + ".insert" }
## Reliance on DNS
Out of the box StatsD is set up to be unidirectional fire-and-forget over UDP. Configuring the StatsD host to be a non-ip will trigger a DNS lookup (ie synchronous round trip network call) for each metric sent. This can be particularly problematic in clouds that have a shared DNS infrastructure such as AWS.

0 comments on commit 125526a

Please sign in to comment.