Net-Statsd-0.13/0000755000175000017500000000000015210066234012766 5ustar cosimocosimoNet-Statsd-0.13/META.yml0000644000175000017500000000136715210066234014246 0ustar cosimocosimo--- abstract: "Perl client for Etsy's statsd daemon" author: - 'Cosimo Streppone ' build_requires: Test::More: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Net-Statsd requires: Carp: '0' IO::Socket: '0' Time::HiRes: '0' resources: bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Statsd repository: git://github.com/cosimo/perl5-net-statsd.git version: '0.13' x_generated_by_perl: v5.38.2 x_serialization_backend: 'YAML::Tiny version 1.74' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' Net-Statsd-0.13/README.pod0000644000175000017500000001026115210066234014427 0ustar cosimocosimo=pod =encoding utf-8 =head1 NAME Net::Statsd - Perl client for Etsy's statsd daemon =head1 SYNOPSIS # Configure where to send events # That's where your statsd daemon is listening. $Net::Statsd::HOST = 'localhost'; # Default $Net::Statsd::PORT = 8125; # Default # # Keep track of events as counters # Net::Statsd::increment('site.logins'); Net::Statsd::increment('database.connects'); # # Log timing of events, ex. db queries # use Time::HiRes; my $start_time = [ Time::HiRes::gettimeofday ]; # do the complex database query # note: time value sent to timing should # be in milliseconds. Net::Statsd::timing( 'database.complexquery', Time::HiRes::tv_interval($start_time) * 1000 ); =head1 DESCRIPTION This module implement a UDP client for the B statistics collector daemon in use at Etsy.com. You want to use this module to track statistics in your Perl application, such as how many times a certain event occurs (user logins in a web application, or database queries issued), or you want to time and then graph how long certain events take, like database queries execution time or time to download a certain file, etc... If you're uncertain whether you'd want to use this module or statsd, then you can read some background information here: http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/ The github repository for statsd is: http://github.com/etsy/statsd By default the client will try to send statistic metrics to C, but you can change the default hostname and port with: $Net::Statsd::HOST = 'your.statsd.hostname.net'; $Net::Statsd::PORT = 9999; just after including the C module. =head1 ABOUT SAMPLING A note about sample rate: A sample rate of < 1 instructs this library to send only the specified percentage of the samples to the server. As such, the application code should call this module for every occurence of each metric and allow this library to determine which specific measurements to deliver, based on the sample_rate value. (e.g. a sample rate of 0.5 would indicate that approximately only half of the metrics given to this module would actually be sent to statsd). =head1 FUNCTIONS =cut =head2 C Log timing information. B