Dezi::Stats - log statistics for your Dezi server
# example Dezi server application use Dezi::Server; use Plack::Runner; use Dezi::Stats; my $app = Dezi::Server->app({ engine_config => { type => 'Lucy', index => ['path/to/your/index'], }, stats_logger => Dezi::Stats->new( type => 'DBI', dsn => "DBI:mysql:database=$database;host=$hostname;port=$port", username => 'myuser', password => 'mysecret', ), }); my $runner = Plack::Runner->new(); $runner->run($app);
Dezi::Stats logs statistics about requests to a Dezi server. There are multiple backend storage options, including DBI-based storage (MySQL, Postgresql, SQLite, etc), file-based, etc.
Returns a new Dezi::Stats object. config should be a series of key/value pairs (a hash). Supported config params are:
The backend storage type. Defaults to 'File' (see Dezi::Stats::File).
If type is DBI then the dsn value will be passed directly to the DBI->connect() method.
DBI
If type is DBI then the username value will be passed directly to the DBI->connect() method.
If type is DBI then the password value will be passed directly to the DBI->connect() method.
If type is DBI then the table_name value will be used to insert rows. Defaults to dezi_stats.
dezi_stats
If type is DBI then the quote value will be used to quote column names on insert. Defaults to false.
false
If type is DBI then the quote_char value will be used when quote is true. Defaults to backtick.
If type is File then the path value is the filesystem path to the log file. See Dezi::Stats::File.
File
All subclasses must implement this abstract method. Called internally in new().
Required method for Search::OpenSearch::Server stats_logger() API.
Expects 2 objects: the current Plack::Request and the resulting Search::OpenSearch::Response.
Calls insert() after pulling data from the request and the response.
Called by log. All subclasses must implement this abstract method.
Peter Karman, <karman at cpan.org>
<karman at cpan.org>
Please report any bugs or feature requests to bug-dezi-stats at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dezi-Stats. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-dezi-stats at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Dezi::Stats
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dezi-Stats
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Dezi-Stats
CPAN Ratings
http://cpanratings.perl.org/d/Dezi-Stats
Search CPAN
http://search.cpan.org/dist/Dezi-Stats/
Copyright 2012 Peter Karman.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Dezi::Stats, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dezi::Stats
CPAN shell
perl -MCPAN -e shell install Dezi::Stats
For more information on module installation, please visit the detailed CPAN module installation guide.