| 1 | package Starch::Plugin::Net::Statsd; | ||
| 2 | 1 | ▶ | use 5.008001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use strictures 2; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | our $VERSION = '0.05'; | |
| 5 | |||
| 6 | =head1 NAME | ||
| 7 | |||
| 8 | Starch::Plugin::Net::Statsd - Record store timing information to statsd. | ||
| 9 | |||
| 10 | =head1 SYNOPSIS | ||
| 11 | |||
| 12 | my $starch = Starch->new( | ||
| 13 | plugins => ['::Net::Statsd'], | ||
| 14 | ); | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | This plugin will record get, set, and remove store timings to statsd | ||
| 19 | using L<Net::Statsd>. | ||
| 20 | |||
| 21 | By default, for example, if you are using L<Starch::Store::Memory>, stats | ||
| 22 | like this will be recorded: | ||
| 23 | |||
| 24 | starch.Memory.set | ||
| 25 | starch.Memory.get-hit | ||
| 26 | starch.Memory.get-miss | ||
| 27 | starch.Memory.remove | ||
| 28 | starch.Memory.set-error | ||
| 29 | starch.Memory.get-error | ||
| 30 | starch.Memory.remove-error | ||
| 31 | |||
| 32 | Note that stats will not be collected for L<Starch::Store::Layered>, as | ||
| 33 | data about it isn't really useful as its just a proxy store. | ||
| 34 | |||
| 35 | Since this plugin detects exceptions and records the C<*-error> stats for | ||
| 36 | them you should, if you are using it, put the L<Starch::Plugin::LogStoreExceptions> | ||
| 37 | plugin after this plugin in the plugins list. If you don't then exceptions | ||
| 38 | will be turned into log messages before this store gets to see them. | ||
| 39 | |||
| 40 | =cut | ||
| 41 | |||
| 42 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 43 | 1 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | |||
| 45 | 1 | with 'Starch::Plugin::Bundle'; | |
| 46 | |||
| 47 | 8 | ▶ | sub bundled_plugins { |
|
Subroutine
bundled_plugins: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 48 | 8 | return [qw( | |
| 49 | ::Net::Statsd::Manager | ||
| 50 | ::Net::Statsd::Store | ||
| 51 | )]; | ||
| 52 | } | ||
| 53 | |||
| 54 | 1 | 1; | |
| 55 | __END__ | ||