Module::CPANTS::Reporter::DB - save metrics in a database
see Module::CPANTS::Reporter
Module::CPANTS::Reporter::DB saves metrics into a database. Any database system can be used, as long as there is an DBI driver available.
You must specify the connection information in the CPANTS config file (.cpants) as an array ref.
# in .cpants dbi_connect=>["dbi:mysql:cpants",'','',{RaiseError=>1}],
This array ref will be passed directly to DBI's connect.
connect
Connects to DB. The DBH is stored in a package global.
Returns the package-globally stored DBH.
Saves metrics into the DB.
As the metrics come as one big hash, the following logic is used to split the date into different tables:
If the value is a string, it will be stored in table 'cpants' using the key as the column name.
If the value is a hashref, the key denotes the name of the table to store the data. The keys and values of the hashref are used as columns and data.
If the value is an arrayref, iterate over the values of the array, which must be hashrefs. The name of the key is again the name of the table. For each array value (which is a hashref), the keys and values of this hash are used as columns and data.
Prior to saving the metrics, all data for the current distribution is deleted.
Not used.
Returns a list of tables by doing an analysis of the metrics data somewhat similar to report, only simpler. This list is used to delete old data.
report
Thomas Klausner <domm@zsi.at>
http://domm.zsi.at
This code is distributed under the same license as Perl.
To install Module::CPANTS::Generator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::CPANTS::Generator
CPAN shell
perl -MCPAN -e shell install Module::CPANTS::Generator
For more information on module installation, please visit the detailed CPAN module installation guide.