| 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<ORLite::Profile> is an experimental profiler for L<ORLite>. It currently | ||
| 24 | serves as an experimental test-bed for more wide-scoped DBI profiling and | ||
| 25 | monitoring modules. | ||
| 26 | |||
| 27 | It weaves L<Aspect>-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<ORLite>-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 | ▶ | use 5.008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 49 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 50 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 51 | 2 | ▶ | use Aspect; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 52 | |||
| 53 | 2 | ▶ | use vars qw{$VERSION}; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 54 | 2 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 55 | 2 | $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<http://rt.cpan.org/Public/Dist/Display.html?Name=ORLite-Profile> | ||
| 69 | |||
| 70 | For other issues, contact the author. | ||
| 71 | |||
| 72 | =head1 AUTHOR | ||
| 73 | |||
| 74 | Adam Kennedy E<lt>adamk@cpan.orgE<gt> | ||
| 75 | |||
| 76 | =head1 SEE ALSO | ||
| 77 | |||
| 78 | L<ORLite::Mirror>, L<ORLite::Migrate> | ||
| 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 | ||