Skip to content
Browse files

add gauges sub

Change-Id: Ife7ee47a048b949fb5796a4f0bcab810e9f4b0f0
  • Loading branch information...
1 parent e82756f commit c172858184464363a673a5803bdff5dd9e39856a Joe Crotty committed Apr 26, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/Net/Statsd.pm
View
18 lib/Net/Statsd.pm
@@ -249,6 +249,24 @@ sub _sample_data {
return $sampled_data;
}
+=head2 C<gauge($stat, $gauge)>
+
+Log arbitrary values.
+
+ Net::Statsd::gauge('some.thing', 15);
+
+=cut
+
+sub gauge {
+ my ($stat, $gauge) = @_;
+
+ my $stats = {
+ $stat => sprintf "%d|g", $gauge
+ };
+
+ return Net::Statsd::send($stats, 1);
+}
+
=head2 C<send(\%data, $sample_rate = 1)>
Squirt the metrics over UDP.

0 comments on commit c172858

Please sign in to comment.
Something went wrong with that request. Please try again.