← 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
StatementsExecuted 36 statements in 1.12ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11154µs110µsTapper::Schema::ReportsDB::Result::Report::::BEGIN@9Tapper::Schema::ReportsDB::Result::Report::BEGIN@9
11112µs12µsTapper::Schema::ReportsDB::Result::Report::::BEGIN@2Tapper::Schema::ReportsDB::Result::Report::BEGIN@2
11110µs56µsTapper::Schema::ReportsDB::Result::Report::::BEGIN@9.32Tapper::Schema::ReportsDB::Result::Report::BEGIN@9.32
11110µs48µsTapper::Schema::ReportsDB::Result::Report::::BEGIN@13Tapper::Schema::ReportsDB::Result::Report::BEGIN@13
1119µs50µsTapper::Schema::ReportsDB::Result::Report::::BEGIN@15Tapper::Schema::ReportsDB::Result::Report::BEGIN@15
1119µs25µsTapper::Schema::ReportsDB::Result::Report::::BEGIN@11Tapper::Schema::ReportsDB::Result::Report::BEGIN@11
1119µs13µsTapper::Schema::ReportsDB::Result::Report::::BEGIN@10Tapper::Schema::ReportsDB::Result::Report::BEGIN@10
1116µs202µsTapper::Schema::ReportsDB::Result::Report::::sqlt_deploy_hookTapper::Schema::ReportsDB::Result::Report::sqlt_deploy_hook
0000s0sTapper::Schema::ReportsDB::Result::Report::::get_cached_tapdomTapper::Schema::ReportsDB::Result::Report::get_cached_tapdom
0000s0sTapper::Schema::ReportsDB::Result::Report::::sections_cpuinfoTapper::Schema::ReportsDB::Result::Report::sections_cpuinfo
0000s0sTapper::Schema::ReportsDB::Result::Report::::sections_osnameTapper::Schema::ReportsDB::Result::Report::sections_osname
0000s0sTapper::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
1package 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 {
315µs $Tapper::Schema::ReportsDB::Result::Report::AUTHORITY = 'cpan:AMD';
4128µs112µs}
5{
621µs $Tapper::Schema::ReportsDB::Result::Report::VERSION = '0.001';
7}
8
9675µs3211µ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
10319µs217µ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
11321µs242µ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
13321µs287µ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
153735µs290µ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
17113µs1425µs__PACKAGE__->load_components(qw(InflateColumn::DateTime TimeStamp Core));
# spent 425µs making 1 call to Class::C3::Componentised::load_components
18116µs1502µs__PACKAGE__->table("report");
# spent 502µs making 1 call to DBIx::Class::ResultSourceProxy::Table::table
19165µs14.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
57120µs154µs__PACKAGE__->set_primary_key("id");
58
59114µs1245µ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
60110µs1180µ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
6113µs1150µ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
6213µs1148µ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
64110µs1106µ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
6512µs197µ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
6613µs198µ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
6712µs198µ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
- -
71sub 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
{
7327µs my ($self, $sqlt_table) = @_;
741196µ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
- -
82sub 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
94sub 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
106sub 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
118sub 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
182147µs1;
183
184__END__