Profile of Tapper/Schema/ReportsDB/Result/ReportgroupTestrunStats.pm

← Index
NYTProf Performance Profile «block view•line view•sub view»
For xt/tapper-mcp-scheduler-with-db-longrun.t
Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:23:14 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Tapper/Schema/ReportsDB/Result/ReportgroupTestrunStats.pm
Statements | Executed 27 statements in 586µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 46µs | 95µs | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::BEGIN@9Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@9
1 | 1 | 1 | 11µs | 11µs | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::BEGIN@2Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@2
1 | 1 | 1 | 10µs | 50µs | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::BEGIN@9.31Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@9.31
1 | 1 | 1 | 9µs | 24µs | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::BEGIN@11Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@11
1 | 1 | 1 | 8µs | 22µs | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::BEGIN@70Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@70
1 | 1 | 1 | 8µs | 12µs | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::BEGIN@10Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@10
1 | 1 | 1 | 8µs | 43µs | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::BEGIN@13Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@13
0 | 0 | 0 | 0s | 0s | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::_success_ratioTapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::_success_ratio
0 | 0 | 0 | 0s | 0s | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::groupreportsTapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::groupreports
0 | 0 | 0 | 0s | 0s | Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::::update_failed_passedTapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::update_failed_passed

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats;
2 |  |  |  |  | # spent 11µs within Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@2 which was called: # once (11µs+0s) by Class::C3::Componentised::ensure_class_loaded at line 4 BEGIN {
3 | 1 | 6µs |  |  | $Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::AUTHORITY = 'cpan:AMD';
4 | 1 | 26µs | 1 | 11µs | } # spent 11µs making 1 call to Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@2
5 |  |  |  |  | {
6 | 2 | 1µs |  |  | $Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::VERSION = '0.001';
7 |  |  |  |  | }
8 |  |  |  |  |
9 | 6 | 66µs | 3 | 185µs | # spent 50µs (10+40) within Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@9.31 which was called: # once (10µs+40µs) by Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@9 at line 9 # spent 95µs (46+50) within Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@9 which was called: # once (46µs+50µs) by Class::C3::Componentised::ensure_class_loaded at line 9 use 5.010; # spent 95µs making 1 call to Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@9 # spent 50µs making 1 call to Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@9.31 # spent 40µs making 1 call to feature::import
10 | 3 | 19µs | 2 | 16µs | # spent 12µs (8+4) within Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@10 which was called: # once (8µs+4µs) by Class::C3::Componentised::ensure_class_loaded at line 10 use strict; # spent 12µs making 1 call to Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@10 # spent 4µs making 1 call to strict::import
11 | 3 | 20µs | 2 | 38µs | # spent 24µs (9+15) within Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@11 which was called: # once (9µs+15µs) by Class::C3::Componentised::ensure_class_loaded at line 11 use warnings; # spent 24µs making 1 call to Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@11 # spent 15µs making 1 call to warnings::import
12 |  |  |  |  |
13 | 3 | 232µs | 2 | 78µs | # spent 43µs (8+35) within Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@13 which was called: # once (8µs+35µs) by Class::C3::Componentised::ensure_class_loaded at line 13 use parent 'DBIx::Class'; # spent 43µs making 1 call to Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@13 # spent 35µs making 1 call to parent::import
14 |  |  |  |  |
15 | 1 | 12µs | 1 | 239µs | __PACKAGE__->load_components("Core"); # spent 239µs making 1 call to Class::C3::Componentised::load_components
16 | 1 | 21µs | 1 | 455µs | __PACKAGE__->table("reportgrouptestrunstats"); # spent 455µs making 1 call to DBIx::Class::ResultSourceProxy::Table::table
17 | 1 | 34µs | 1 | 1.61ms | __PACKAGE__->add_columns # spent 1.61ms making 1 call to DBIx::Class::ResultSourceProxy::add_columns
18 |  |  |  |  | (
19 |  |  |  |  | "testrun_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_foreign_key => 1, },
20 |  |  |  |  | "total", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
21 |  |  |  |  | "failed", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
22 |  |  |  |  | "passed", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
23 |  |  |  |  | "parse_errors", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
24 |  |  |  |  | "skipped", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
25 |  |  |  |  | "todo", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
26 |  |  |  |  | "todo_passed", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
27 |  |  |  |  | "wait", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
28 |  |  |  |  | "success_ratio", { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 20, },
29 |  |  |  |  | # "exit" makes wrong SQL
30 |  |  |  |  | # "exit", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
31 |  |  |  |  | );
32 |  |  |  |  |
33 | 1 | 18µs | 1 | 63µs | __PACKAGE__->set_primary_key(qw/testrun_id/); # spent 63µs making 1 call to DBIx::Class::ResultSourceProxy::set_primary_key
34 |  |  |  |  |
35 | 1 | 10µs | 1 | 179µs | __PACKAGE__->has_many ( reportgrouptestruns => 'Tapper::Schema::ReportsDB::Result::ReportgroupTestrun', { 'foreign.testrun_id' => 'self.testrun_id' }, {cascade_delete => 0, cascade_copy => 0 } ); # spent 179µs making 1 call to DBIx::Class::Relationship::HasMany::has_many
36 |  |  |  |  |
- - |  |  |  |  |
39 |  |  |  |  | sub groupreports {
40 |  |  |  |  | my ($self) = @_;
41 |  |  |  |  |
42 |  |  |  |  | $self->reportgrouptestruns->groupreports;
43 |  |  |  |  | }
44 |  |  |  |  |
45 |  |  |  |  |
46 |  |  |  |  | sub _success_ratio
47 |  |  |  |  | {
48 |  |  |  |  | my ($self) = @_;
49 |  |  |  |  |
50 |  |  |  |  | my $ratio = sprintf("%02.2f", $self->total ? ($self->passed / $self->total * 100) : 100 );
51 |  |  |  |  | return $ratio;
52 |  |  |  |  | }
53 |  |  |  |  |
54 |  |  |  |  |
55 |  |  |  |  | sub update_failed_passed
56 |  |  |  |  | {
57 |  |  |  |  | my ($self) = @_;
58 |  |  |  |  |
59 |  |  |  |  | my $failed = 0;
60 |  |  |  |  | my $passed = 0;
61 |  |  |  |  | my $total = 0;
62 |  |  |  |  | my $parse_errors = 0;
63 |  |  |  |  | my $skipped = 0;
64 |  |  |  |  | my $todo = 0;
65 |  |  |  |  | my $todo_passed = 0;
66 |  |  |  |  | my $wait = 0;
67 |  |  |  |  | my $exit = 0;
68 |  |  |  |  |
69 |  |  |  |  | my $reports_rs = $self->groupreports;
70 | 3 | 101µs | 2 | 37µs | # spent 22µs (8+14) within Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@70 which was called: # once (8µs+14µs) by Class::C3::Componentised::ensure_class_loaded at line 70 no strict 'refs'; ## no critic (ProhibitNoStrict) # spent 22µs making 1 call to Tapper::Schema::ReportsDB::Result::ReportgroupTestrunStats::BEGIN@70 # spent 14µs making 1 call to strict::unimport
71 |  |  |  |  | my %sums = ();
72 |  |  |  |  | my @stat_fields = (qw/failed passed total parse_errors skipped todo todo_passed wait/); # no "exit", that would create wrong SQL
73 |  |  |  |  | while (my $r = $reports_rs->next) {
74 |  |  |  |  | $sums{$_} += ($r->$_ // 0) foreach @stat_fields;
75 |  |  |  |  | }
76 |  |  |  |  | $self->$_($sums{$_}) foreach @stat_fields;
77 |  |  |  |  | $self->success_ratio( $self->_success_ratio );
78 |  |  |  |  | return $self;
79 |  |  |  |  | }
80 |  |  |  |  |
81 | 1 | 21µs |  |  | 1;
82 |  |  |  |  |
83 |  |  |  |  | __END__