The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CPAN::Testers::Schema::Result::Stats - The basic statistics information extracted from test reports

VERSION

version 0.025

SYNOPSIS

    my $schema = CPAN::Testers::Schema->connect( $dsn, $user, $pass );

    # Retrieve a row
    my $row = $schema->resultset( 'Stats' )->first;
    # pass from doug@example.com (Doug Bell) using Perl 5.20.1 on darwin
    say sprintf "%s from %s using Perl %s on %s",
        $row->state,
        $row->tester,
        $row->perl,
        $row->osname;

    # Create a new row
    my %new_row_data = (
        state => 'fail',
        guid => '00000000-0000-0000-0000-000000000000',
        tester => 'doug@example.com (Doug Bell)',
        postdate => '201608',
        dist => 'My-Dist',
        version => '0.001',
        platform => 'darwin-2level',
        perl => '5.22.0',
        osname => 'darwin',
        osvers => '10.8.0',
        fulldate => '201608120401',
        type => 2,
        uploadid => 287102,
    );
    my $new_row = $schema->resultset( 'Stats' )->insert( \%new_row_data );

DESCRIPTION

This table (cpanstats in the database) hold the basic, vital statistics extracted from test reports. This data is used to generate reports for the web application and web APIs.

See ATTRIBUTES below for the full list of attributes.

This data is built from the Metabase by the CPAN::Testers::Data::Generator.

ATTRIBUTES

id

The ID of the row. Auto-generated.

guid

The UUID of this report from the Metabase, stored in standard hex string representation.

state

The state of the report. One of:

pass

The tests passed and everything went well.

fail

The tests ran but failed.

na

This dist is incompatible with the tester's Perl or OS.

unknown

The state could not be determined.

invalid reports, which are marked that way by dist authors when the problem is on the tester's machine, are handled by the "type" field.

postdate

A truncated date, consisting only of the year and month in YYYYMM format.

tester

The e-mail address of the tester who sent this report, optionally with the tester's name as a comment (doug@example.com (Doug Bell)).

dist

The distribution that was tested.

version

The version of the distribution.

platform

The Perl platform string (from $Config{archname}).

perl

The version of Perl that was used to run the tests (from $Config{version}).

osname

The name of the operating system (from $Config{osname}).

osvers

The version of the operating system (from $Config{osvers}).

fulldate

The full date of the report, with hours and minutes, in YYYYMMDDHHNN format.

type

A field that declares the status of this row. The only current possibilities are:

2 - This is a valid Perl 5 test report
3 - This report was marked invalid by a user

uploadid

The ID of the upload that created this dist. Related to the uploadid field in the uploads table (see CPAN::Testers::Schema::Result::Uploads).

METHODS

upload

Get the related row in the `uploads` table. See CPAN::Testers::Schema::Result::Upload.

perl_version

Get the related metadata about the Perl version this report is for. See CPAN::Testers::Schema::Result::PerlVersion.

dist_name

The name of the distribution that was tested.

dist_version

The version of the distribution that was tested.

lang_version

The language and version the test was executed with

platform

The platform the test was run on

grade

The report grade. One of 'pass', 'fail', 'na', 'unknown'.

tester_name

The name of the tester who sent the report

SEE ALSO

DBIx::Class::Row, CPAN::Testers::Schema

AUTHORS

  • Oriol Soriano <oriolsoriano@gmail.com>

  • Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Oriol Soriano, Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.