File Coverage

blib/lib/Starch/Plugin/Net/Statsd.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 14 15 93.3


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