Profile of Tapper/Schema/ReportsDB/Result/Report.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:15 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Tapper/Schema/ReportsDB/Result/Report.pm
Statements | Executed 36 statements in 1.12ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 54µs | 110µs | Tapper::Schema::ReportsDB::Result::Report::::BEGIN@9Tapper::Schema::ReportsDB::Result::Report::BEGIN@9
1 | 1 | 1 | 12µs | 12µs | Tapper::Schema::ReportsDB::Result::Report::::BEGIN@2Tapper::Schema::ReportsDB::Result::Report::BEGIN@2
1 | 1 | 1 | 10µs | 56µs | Tapper::Schema::ReportsDB::Result::Report::::BEGIN@9.32Tapper::Schema::ReportsDB::Result::Report::BEGIN@9.32
1 | 1 | 1 | 10µs | 48µs | Tapper::Schema::ReportsDB::Result::Report::::BEGIN@13Tapper::Schema::ReportsDB::Result::Report::BEGIN@13
1 | 1 | 1 | 9µs | 50µs | Tapper::Schema::ReportsDB::Result::Report::::BEGIN@15Tapper::Schema::ReportsDB::Result::Report::BEGIN@15
1 | 1 | 1 | 9µs | 25µs | Tapper::Schema::ReportsDB::Result::Report::::BEGIN@11Tapper::Schema::ReportsDB::Result::Report::BEGIN@11
1 | 1 | 1 | 9µs | 13µs | Tapper::Schema::ReportsDB::Result::Report::::BEGIN@10Tapper::Schema::ReportsDB::Result::Report::BEGIN@10
1 | 1 | 1 | 6µs | 202µs | Tapper::Schema::ReportsDB::Result::Report::::sqlt_deploy_hookTapper::Schema::ReportsDB::Result::Report::sqlt_deploy_hook
0 | 0 | 0 | 0s | 0s | Tapper::Schema::ReportsDB::Result::Report::::get_cached_tapdomTapper::Schema::ReportsDB::Result::Report::get_cached_tapdom
0 | 0 | 0 | 0s | 0s | Tapper::Schema::ReportsDB::Result::Report::::sections_cpuinfoTapper::Schema::ReportsDB::Result::Report::sections_cpuinfo
0 | 0 | 0 | 0s | 0s | Tapper::Schema::ReportsDB::Result::Report::::sections_osnameTapper::Schema::ReportsDB::Result::Report::sections_osname
0 | 0 | 0 | 0s | 0s | Tapper::Schema::ReportsDB::Result::Report::::some_meta_availableTapper::Schema::ReportsDB::Result::Report::some_meta_available

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::Report;
2 |  |  |  |  | # spent 12µs within Tapper::Schema::ReportsDB::Result::Report::BEGIN@2 which was called: # once (12µs+0s) by Class::C3::Componentised::ensure_class_loaded at line 4 BEGIN {
3 | 1 | 5µs |  |  | $Tapper::Schema::ReportsDB::Result::Report::AUTHORITY = 'cpan:AMD';
4 | 1 | 28µs | 1 | 12µs | } # spent 12µs making 1 call to Tapper::Schema::ReportsDB::Result::Report::BEGIN@2
5 |  |  |  |  | {
6 | 2 | 1µs |  |  | $Tapper::Schema::ReportsDB::Result::Report::VERSION = '0.001';
7 |  |  |  |  | }
8 |  |  |  |  |
9 | 6 | 75µs | 3 | 211µs | # spent 56µs (10+46) within Tapper::Schema::ReportsDB::Result::Report::BEGIN@9.32 which was called: # once (10µs+46µs) by Tapper::Schema::ReportsDB::Result::Report::BEGIN@9 at line 9 # spent 110µs (54+56) within Tapper::Schema::ReportsDB::Result::Report::BEGIN@9 which was called: # once (54µs+56µs) by Class::C3::Componentised::ensure_class_loaded at line 9 use 5.010; # spent 110µs making 1 call to Tapper::Schema::ReportsDB::Result::Report::BEGIN@9 # spent 56µs making 1 call to Tapper::Schema::ReportsDB::Result::Report::BEGIN@9.32 # spent 46µs making 1 call to feature::import
10 | 3 | 19µs | 2 | 17µs | # spent 13µs (9+4) within Tapper::Schema::ReportsDB::Result::Report::BEGIN@10 which was called: # once (9µs+4µs) by Class::C3::Componentised::ensure_class_loaded at line 10 use strict; # spent 13µs making 1 call to Tapper::Schema::ReportsDB::Result::Report::BEGIN@10 # spent 4µs making 1 call to strict::import
11 | 3 | 21µs | 2 | 42µs | # spent 25µs (9+16) within Tapper::Schema::ReportsDB::Result::Report::BEGIN@11 which was called: # once (9µs+16µs) by Class::C3::Componentised::ensure_class_loaded at line 11 use warnings; # spent 25µs making 1 call to Tapper::Schema::ReportsDB::Result::Report::BEGIN@11 # spent 16µs making 1 call to warnings::import
12 |  |  |  |  |
13 | 3 | 21µs | 2 | 87µs | # spent 48µs (10+39) within Tapper::Schema::ReportsDB::Result::Report::BEGIN@13 which was called: # once (10µs+39µs) by Class::C3::Componentised::ensure_class_loaded at line 13 use parent 'DBIx::Class'; # spent 48µs making 1 call to Tapper::Schema::ReportsDB::Result::Report::BEGIN@13 # spent 39µs making 1 call to parent::import
14 |  |  |  |  |
15 | 3 | 735µs | 2 | 90µs | # spent 50µs (9+40) within Tapper::Schema::ReportsDB::Result::Report::BEGIN@15 which was called: # once (9µs+40µs) by Class::C3::Componentised::ensure_class_loaded at line 15 use Data::Dumper; # spent 50µs making 1 call to Tapper::Schema::ReportsDB::Result::Report::BEGIN@15 # spent 40µs making 1 call to Exporter::import
16 |  |  |  |  |
17 | 1 | 13µs | 1 | 425µs | __PACKAGE__->load_components(qw(InflateColumn::DateTime TimeStamp Core)); # spent 425µs making 1 call to Class::C3::Componentised::load_components
18 | 1 | 16µs | 1 | 502µs | __PACKAGE__->table("report"); # spent 502µs making 1 call to DBIx::Class::ResultSourceProxy::Table::table
19 | 1 | 65µs | 1 | 4.25ms | __PACKAGE__->add_columns # spent 4.25ms making 1 call to DBIx::Class::TimeStamp::add_columns
20 |  |  |  |  | (
21 |  |  |  |  | "id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_auto_increment => 1, },
22 |  |  |  |  | "suite_id", { data_type => "INT", default_value => undef, is_nullable => 1, size => 11, is_foreign_key => 1, },
23 |  |  |  |  | "suite_version", { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 11, },
24 |  |  |  |  | "reportername", { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 100, },
25 |  |  |  |  | "peeraddr", { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 20, },
26 |  |  |  |  | "peerport", { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 20, },
27 |  |  |  |  | "peerhost", { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 255, },
28 |  |  |  |  | #
29 |  |  |  |  | # tap parse result and its human interpretation
30 |  |  |  |  | #
31 |  |  |  |  | "successgrade", { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 10, },
32 |  |  |  |  | "reviewed_successgrade", { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 10, },
33 |  |  |  |  | #
34 |  |  |  |  | # tap parse results
35 |  |  |  |  | #
36 |  |  |  |  | "total", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
37 |  |  |  |  | "failed", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
38 |  |  |  |  | "parse_errors", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
39 |  |  |  |  | "passed", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
40 |  |  |  |  | "skipped", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
41 |  |  |  |  | "todo", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
42 |  |  |  |  | "todo_passed", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
43 |  |  |  |  | "wait", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
44 |  |  |  |  | "exit", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
45 |  |  |  |  | "success_ratio", { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 20, },
46 |  |  |  |  | #
47 |  |  |  |  | "starttime_test_program", { data_type => "DATETIME", default_value => undef, is_nullable => 1, },
48 |  |  |  |  | "endtime_test_program", { data_type => "DATETIME", default_value => undef, is_nullable => 1, },
49 |  |  |  |  | #
50 |  |  |  |  | "machine_name", { data_type => "VARCHAR", default_value => "", is_nullable => 1, size => 50, },
51 |  |  |  |  | "machine_description", { data_type => "TEXT", default_value => "", is_nullable => 1, },
52 |  |  |  |  | #
53 |  |  |  |  | "created_at", { data_type => "DATETIME", default_value => undef, is_nullable => 0, set_on_create => 1, },
54 |  |  |  |  | "updated_at", { data_type => "DATETIME", default_value => undef, is_nullable => 0, set_on_create => 1, set_on_update => 1, },
55 |  |  |  |  | );
56 |  |  |  |  |
57 | 1 | 20µs | 1 | 54µs | __PACKAGE__->set_primary_key("id"); # spent 54µs making 1 call to DBIx::Class::ResultSourceProxy::set_primary_key
58 |  |  |  |  |
59 | 1 | 14µs | 1 | 245µs | __PACKAGE__->belongs_to ( suite => 'Tapper::Schema::ReportsDB::Result::Suite', { 'foreign.id' => 'self.suite_id' }, { 'join_type' => 'LEFT OUTER' }); # spent 245µs making 1 call to DBIx::Class::Relationship::BelongsTo::belongs_to
60 | 1 | 10µs | 1 | 180µs | __PACKAGE__->might_have ( reportgrouparbitrary => 'Tapper::Schema::ReportsDB::Result::ReportgroupArbitrary', { 'foreign.report_id' => 'self.id' }, { 'join_type' => 'LEFT OUTER' }); # spent 180µs making 1 call to DBIx::Class::Relationship::HasOne::might_have
61 | 1 | 3µs | 1 | 150µs | __PACKAGE__->might_have ( reportgrouptestrun => 'Tapper::Schema::ReportsDB::Result::ReportgroupTestrun', { 'foreign.report_id' => 'self.id' }, { 'join_type' => 'LEFT OUTER' }); # spent 150µs making 1 call to DBIx::Class::Relationship::HasOne::might_have
62 | 1 | 3µs | 1 | 148µs | __PACKAGE__->might_have ( tap => 'Tapper::Schema::ReportsDB::Result::Tap', { 'foreign.report_id' => 'self.id' }, { 'join_type' => 'LEFT OUTER' }); # spent 148µs making 1 call to DBIx::Class::Relationship::HasOne::might_have
63 |  |  |  |  |
64 | 1 | 10µs | 1 | 106µs | __PACKAGE__->has_many ( comments => 'Tapper::Schema::ReportsDB::Result::ReportComment', { 'foreign.report_id' => 'self.id' }); # spent 106µs making 1 call to DBIx::Class::Relationship::HasMany::has_many
65 | 1 | 2µs | 1 | 97µs | __PACKAGE__->has_many ( topics => 'Tapper::Schema::ReportsDB::Result::ReportTopic', { 'foreign.report_id' => 'self.id' }); # spent 97µs making 1 call to DBIx::Class::Relationship::HasMany::has_many
66 | 1 | 3µs | 1 | 98µs | __PACKAGE__->has_many ( files => 'Tapper::Schema::ReportsDB::Result::ReportFile', { 'foreign.report_id' => 'self.id' }); # spent 98µs making 1 call to DBIx::Class::Relationship::HasMany::has_many
67 | 1 | 2µs | 1 | 98µs | __PACKAGE__->has_many ( reportsections => 'Tapper::Schema::ReportsDB::Result::ReportSection', { 'foreign.report_id' => 'self.id' }); # spent 98µs making 1 call to DBIx::Class::Relationship::HasMany::has_many
68 |  |  |  |  |
- - |  |  |  |  |
71 |  |  |  |  | sub sqlt_deploy_hook
72 |  |  |  |  | # spent 202µs (6+196) within Tapper::Schema::ReportsDB::Result::Report::sqlt_deploy_hook which was called: # once (6µs+196µs) by DBIx::Class::ResultSource::default_sqlt_deploy_hook at line 951 of DBIx/Class/ResultSource.pm {
73 | 2 | 7µs |  |  | my ($self, $sqlt_table) = @_;
74 |  |  | 1 | 196µs | $sqlt_table->add_index(name => 'report_idx_machine_name', fields => ['machine_name']); # spent 196µs making 1 call to SQL::Translator::Schema::Table::add_index
75 |  |  |  |  | }
76 |  |  |  |  |
77 |  |  |  |  | #sub suite_name { shift->suite->name }
78 |  |  |  |  | #sub suite_name { my ($self, $arg) = @_; return $self->search({ "suite.name" => $arg })};
79 |  |  |  |  |
- - |  |  |  |  |
82 |  |  |  |  | sub sections_cpuinfo
83 |  |  |  |  | {
84 |  |  |  |  | my ($self) = @_;
85 |  |  |  |  | my $sections = $self->reportsections;
86 |  |  |  |  | my @cpus;
87 |  |  |  |  | while (my $section = $sections->next) {
88 |  |  |  |  | push @cpus, $section->cpuinfo;
89 |  |  |  |  | }
90 |  |  |  |  | return @cpus;
91 |  |  |  |  | }
92 |  |  |  |  |
93 |  |  |  |  |
94 |  |  |  |  | sub sections_osname
95 |  |  |  |  | {
96 |  |  |  |  | my ($self) = @_;
97 |  |  |  |  | my $sections = $self->reportsections;
98 |  |  |  |  | my @cpus;
99 |  |  |  |  | while (my $section = $sections->next) {
100 |  |  |  |  | push @cpus, $section->osname;
101 |  |  |  |  | }
102 |  |  |  |  | return @cpus;
103 |  |  |  |  | }
104 |  |  |  |  |
105 |  |  |  |  |
106 |  |  |  |  | sub some_meta_available
107 |  |  |  |  | {
108 |  |  |  |  | my ($self) = @_;
109 |  |  |  |  |
110 |  |  |  |  | my $sections = $self->reportsections;
111 |  |  |  |  | while (my $section = $sections->next) {
112 |  |  |  |  | return 1 if $section->some_meta_available;
113 |  |  |  |  | }
114 |  |  |  |  | return 0;
115 |  |  |  |  | }
116 |  |  |  |  |
117 |  |  |  |  |
118 |  |  |  |  | sub get_cached_tapdom
119 |  |  |  |  | {
120 |  |  |  |  | my ($r) = @_;
121 |  |  |  |  |
122 |  |  |  |  | require Tapper::TAP::Harness;
123 |  |  |  |  | require TAP::DOM;
124 |  |  |  |  |
125 |  |  |  |  | my $TAPVERSION = "TAP Version 13";
126 |  |  |  |  | my $tapdom_sections = [];
127 |  |  |  |  |
128 |  |  |  |  | my $report = $r->result_source->schema->resultset('Report')->find($r->id);
129 |  |  |  |  | my $tapdom_str = $report->tap->tapdom;
130 |  |  |  |  |
131 |  |  |  |  | # set TAPPER_FORCE_NEW_TAPDOM to force the re-generation of the TAP DOM, e.g. when the TAP::DOM module changes
132 |  |  |  |  | if ($tapdom_str and not -e '/tmp/TAPPER_FORCE_NEW_TAPDOM')
133 |  |  |  |  | {
134 |  |  |  |  | #say STDERR "EVAL ", $r->id;
135 |  |  |  |  | eval '$tapdom_sections = my '.$tapdom_str; ## no critic (ProhibitStringyEval)
136 |  |  |  |  | }
137 |  |  |  |  | else
138 |  |  |  |  | {
139 |  |  |  |  | # say STDERR "RUN TAPPER::TAP::HARNESS ", $r->id;
140 |  |  |  |  |
141 |  |  |  |  | my $report_tap = $report->tap->tap;
142 |  |  |  |  | my $tap_is_archive = $report->tap->tap_is_archive || 0;
143 |  |  |  |  |
144 |  |  |  |  | # We got "Out of memory!" with monster TAP reports.
145 |  |  |  |  | if (length $report_tap > 2_000_000) {
146 |  |  |  |  | warn "Ignore report ".$r->id." due to too large TAP. ";
147 |  |  |  |  | }
148 |  |  |  |  | else
149 |  |  |  |  | {
150 |  |  |  |  | my $harness = new Tapper::TAP::Harness( tap => $report_tap,
151 |  |  |  |  | tap_is_archive => $tap_is_archive );
152 |  |  |  |  | $harness->evaluate_report();
153 |  |  |  |  | #print STDERR Dumper($harness->parsed_report);
154 |  |  |  |  | foreach (@{$harness->parsed_report->{tap_sections}})
155 |  |  |  |  | {
156 |  |  |  |  | #print STDERR ".";
157 |  |  |  |  | my $rawtap = $_->{raw} || '';
158 |  |  |  |  | #say STDERR "x"x100, "\n", $rawtap, "\n", "x"x 100;
159 |  |  |  |  | $rawtap = $TAPVERSION."\n".$rawtap unless $rawtap =~ /^TAP Version/ms;
160 |  |  |  |  | #say STDERR length($rawtap);
161 |  |  |  |  | my $tapdom = new TAP::DOM ( tap => $rawtap,
162 |  |  |  |  | ignore => [qw( raw as_string )],
163 |  |  |  |  | ignorelines => qr/^\#\# /, # mostly used in oprofile
164 |  |  |  |  | );
165 |  |  |  |  | push @$tapdom_sections, { section => { $_->{section_name} => { tap => $tapdom,
166 |  |  |  |  | meta => $_->{section_meta},
167 |  |  |  |  | }
168 |  |  |  |  | }
169 |  |  |  |  | };
170 |  |  |  |  | }
171 |  |  |  |  | $tapdom_str = Dumper($tapdom_sections);
172 |  |  |  |  | $report->tap->tapdom( $tapdom_str );
173 |  |  |  |  | #say STDERR "new report: ", Dumper($report);
174 |  |  |  |  | $report->tap->update;
175 |  |  |  |  | $report->update;
176 |  |  |  |  | }
177 |  |  |  |  | }
178 |  |  |  |  | #print STDERR ".\n";
179 |  |  |  |  | return $tapdom_sections;
180 |  |  |  |  | }
181 |  |  |  |  |
182 | 1 | 47µs |  |  | 1;
183 |  |  |  |  |
184 |  |  |  |  | __END__