File Coverage

blib/lib/Starch/Plugin/Net/Statsd.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 17 18 94.4


line stmt bran cond sub pod time code
1             package Starch::Plugin::Net::Statsd;
2 1     1   5440 use 5.008001;
  1         4  
3 1     1   6 use strictures 2;
  1         9  
  1         39  
4             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.
20              
21             By default, for example, if you are using L, 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, 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
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     1   246 use Moo;
  1         3  
  1         7  
43 1     1   351 use namespace::clean;
  1         2  
  1         10  
44              
45             with 'Starch::Plugin::Bundle';
46              
47             sub bundled_plugins {
48 8     8 0 152947 return [qw(
49             ::Net::Statsd::Manager
50             ::Net::Statsd::Store
51             )];
52             }
53              
54             1;
55             __END__