← 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:22:37 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Tapper/Schema/TestrunDB/Result/Precondition.pm
StatementsExecuted 27 statements in 669µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11112µs12µsTapper::Schema::TestrunDB::Result::Precondition::::BEGIN@2Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@2
11111µs72µsTapper::Schema::TestrunDB::Result::Precondition::::BEGIN@13Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@13
1119µs46µsTapper::Schema::TestrunDB::Result::Precondition::::BEGIN@12Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@12
1119µs14µsTapper::Schema::TestrunDB::Result::Precondition::::BEGIN@9Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@9
1119µs26µsTapper::Schema::TestrunDB::Result::Precondition::::BEGIN@10Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@10
0000s0sTapper::Schema::TestrunDB::Result::Precondition::::one_lineTapper::Schema::TestrunDB::Result::Precondition::one_line
0000s0sTapper::Schema::TestrunDB::Result::Precondition::::precondition_as_hashTapper::Schema::TestrunDB::Result::Precondition::precondition_as_hash
0000s0sTapper::Schema::TestrunDB::Result::Precondition::::quoteTapper::Schema::TestrunDB::Result::Precondition::quote
0000s0sTapper::Schema::TestrunDB::Result::Precondition::::quote_and_one_lineTapper::Schema::TestrunDB::Result::Precondition::quote_and_one_line
0000s0sTapper::Schema::TestrunDB::Result::Precondition::::to_stringTapper::Schema::TestrunDB::Result::Precondition::to_string
0000s0sTapper::Schema::TestrunDB::Result::Precondition::::update_contentTapper::Schema::TestrunDB::Result::Precondition::update_content
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::TestrunDB::Result::Precondition;
2
# spent 12µs within Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@2 which was called: # once (12µs+0s) by Class::C3::Componentised::ensure_class_loaded at line 4
BEGIN {
315µs $Tapper::Schema::TestrunDB::Result::Precondition::AUTHORITY = 'cpan:AMD';
4129µs112µs}
5{
62900ns $Tapper::Schema::TestrunDB::Result::Precondition::VERSION = '0.001';
7}
8
9319µs218µs
# spent 14µs (9+4) within Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@9 which was called: # once (9µs+4µs) by Class::C3::Componentised::ensure_class_loaded at line 9
use strict;
# spent 14µs making 1 call to Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@9 # spent 4µs making 1 call to strict::import
10322µs243µs
# spent 26µs (9+17) within Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@10 which was called: # once (9µs+17µs) by Class::C3::Componentised::ensure_class_loaded at line 10
use warnings;
# spent 26µs making 1 call to Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@10 # spent 17µs making 1 call to warnings::import
11
12320µs283µs
# spent 46µs (9+37) within Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@12 which was called: # once (9µs+37µs) by Class::C3::Componentised::ensure_class_loaded at line 12
use parent 'DBIx::Class';
# spent 46µs making 1 call to Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@12 # spent 37µs making 1 call to parent::import
133456µs2132µs
# spent 72µs (11+60) within Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@13 which was called: # once (11µs+60µs) by Class::C3::Componentised::ensure_class_loaded at line 13
use YAML::Syck;
# spent 72µs making 1 call to Tapper::Schema::TestrunDB::Result::Precondition::BEGIN@13 # spent 60µs making 1 call to Exporter::import
14
15111µs1236µs__PACKAGE__->load_components("Core");
# spent 236µs making 1 call to Class::C3::Componentised::load_components
16120µs1440µs__PACKAGE__->table("precondition");
# spent 440µs making 1 call to DBIx::Class::ResultSourceProxy::Table::table
17126µs1641µs__PACKAGE__->add_columns
# spent 641µs making 1 call to DBIx::Class::ResultSourceProxy::add_columns
18 (
19 "id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_auto_increment => 1, },
20 "shortname", { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 255, },
21 "precondition", { data_type => "TEXT", default_value => undef, is_nullable => 1, },
22 "timeout", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10, },
23 );
24
25116µs158µs__PACKAGE__->set_primary_key("id");
26
2718µs1173µs__PACKAGE__->has_many ( child_pre_precondition => 'Tapper::Schema::TestrunDB::Result::PrePrecondition', { 'foreign.parent_precondition_id' => 'self.id' });
# spent 173µs making 1 call to DBIx::Class::Relationship::HasMany::has_many
2818µs1165µs__PACKAGE__->many_to_many ( child_preconditions => 'child_pre_precondition', 'child' );
29
3013µs198µs__PACKAGE__->has_many ( parent_pre_precondition => 'Tapper::Schema::TestrunDB::Result::PrePrecondition', { 'foreign.child_precondition_id' => 'self.id' });
# spent 98µs making 1 call to DBIx::Class::Relationship::HasMany::has_many
3112µs1133µs__PACKAGE__->many_to_many ( parent_preconditions => 'parent_pre_precondition', 'parent' );
32
3314µs1100µs__PACKAGE__->has_many ( testrun_precondition => 'Tapper::Schema::TestrunDB::Result::TestrunPrecondition', { 'foreign.precondition_id' => 'self.id' }, { 'join_type' => 'INNER' });
# spent 100µs making 1 call to DBIx::Class::Relationship::HasMany::has_many
3411µs1127µs__PACKAGE__->many_to_many ( parent_testruns => 'testrun_precondition', 'testrun' );
35
361200ns1;
37
38# -------------------- methods in results --------------------
39
40
41sub one_line {
42 my ($str) = @_;
43
44 $str =~ s/\\/\\\\/msg;
45 $str =~ s/\n/\\n/msg;
46 $str;
47}
48
49
50sub quote {
51 my ($str) = @_;
52
53 my $d = Data::Dumper->new([$str])->Terse(1)->Indent(0);
54 $d->Dump;
55}
56
57
58sub quote_and_one_line {
59 my ($str) = @_;
60
61 $str = quote($str);
62 $str =~ s/\n/\\n/msg;
63 $str;
64}
65
66
67sub to_string
68{
69 my ($self, $opt) = @_;
70
71 my $str = '';
72 foreach (@{$self->result_source->{_ordered_columns} })
73 {
74 my $val = $self->$_;
75 if (defined $val)
76 {
77 if ( $opt->{quotevalues} && $opt->{nonewlines} ) {
78 $val = quote_and_one_line($val);
79 } else {
80 $val = quote($val) if $opt->{quotevalues};
81 $val = one_line($val) if $opt->{nonewlines};
82 }
83 } else
84 {
85 $val = $Tapper::Schema::TestrunDB::NULL;
86 }
87 $str .= $val . $Tapper::Schema::TestrunDB::DELIM;
88 }
89 return $str;
90}
91
92
93sub precondition_as_hash {
94 Load(shift->precondition);
95}
96
97
98sub update_content {
99 my ($self, $condition) = @_;
100
101 my $yaml_error = Tapper::Schema::TestrunDB::_yaml_ok($condition);
102 die Tapper::Exception::Param->new($yaml_error) if $yaml_error;
103
104 my $cond_hash = Load($condition);
105
106 $self->shortname( $cond_hash->{shortname} ) if $cond_hash->{shortname};
107 $self->precondition( $condition );
108 $self->timeout( $cond_hash->{timeout} ) if $cond_hash->{timeout};
109 $self->update;
110
111 return $self->id;
112}
113
114118µs1;
115
- -
118__END__