File Coverage

blib/lib/ORLite/Profile.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 22 22 100.0


line stmt bran cond sub pod time code
1             package ORLite::Profile;
2              
3             =pod
4              
5             =head1 NAME
6              
7             ORLite::Profile - Experimental Aspect-Oriented Profiler for ORLite
8              
9             =head1 SYNOPSIS
10              
11             # Load your ORLite database
12             use My::ORLiteDB;
13            
14             # Load the profiler
15             use ORLite::Profile;
16            
17             # Stimulate the load you want to profile here.
18             # When the program exists, the profiling data
19             # will ne printed to STDERR.
20              
21             =head1 DESCRIPTION
22              
23             B is an experimental profiler for L. It currently
24             serves as an experimental test-bed for more wide-scoped DBI profiling and
25             monitoring modules.
26              
27             It weaves L-based profiling logic into the DBI layer,
28             below the ORLite logic itself.
29              
30             At the present time, the main purpose of this module is to
31             examine the aggregate total time spent in the connect, prepare,
32             and execute tasks.
33              
34             I hope to expand this in the future to capture more interesting
35             types of data.
36              
37             =head1 Using This Module
38              
39             This module has no interface and takes no options.
40              
41             You just load it after your L-based class is loaded, and
42             then generate some test load.
43              
44             When the program exits, the profing information is written to STDERR.
45              
46             =cut
47              
48 2     2   208021 use 5.008;
  2         8  
  2         80  
49 2     2   11 use strict;
  2         4  
  2         69  
50 2     2   22 use warnings;
  2         5  
  2         68  
51 2     2   2262 use Aspect;
  2         537218  
  2         18  
52              
53 2     2   1658 use vars qw{$VERSION};
  2         4  
  2         118  
54             BEGIN {
55 2     2   317 $VERSION = '0.01';
56             }
57              
58             aspect Profiler => call qr/^DBI::(?:connect|db::prepare|db::do|db::select|st::execute|st::fetch)/;
59              
60             1;
61              
62             =pod
63              
64             =head1 SUPPORT
65              
66             Bugs should be reported via the CPAN bug tracker at
67              
68             L
69              
70             For other issues, contact the author.
71              
72             =head1 AUTHOR
73              
74             Adam Kennedy Eadamk@cpan.orgE
75              
76             =head1 SEE ALSO
77              
78             L, L
79              
80             =head1 COPYRIGHT
81              
82             Copyright 2008 - 2009 Adam Kennedy.
83              
84             This program is free software; you can redistribute
85             it and/or modify it under the same terms as Perl itself.
86              
87             The full text of the license can be found in the
88             LICENSE file included with this module.
89              
90             =cut