| Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Tapper/Schema/TestrunDB/ResultSet/Precondition.pm |
| Statements | Executed 16 statements in 254µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 11µs | 11µs | Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@2 |
| 1 | 1 | 1 | 9µs | 66µs | Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@13 |
| 1 | 1 | 1 | 9µs | 26µs | Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@10 |
| 1 | 1 | 1 | 9µs | 52µs | Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@12 |
| 1 | 1 | 1 | 9µs | 14µs | Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@9 |
| 0 | 0 | 0 | 0s | 0s | Tapper::Schema::TestrunDB::ResultSet::Precondition::add |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Tapper::Schema::TestrunDB::ResultSet::Precondition; | ||||
| 2 | # spent 11µs within Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@2 which was called:
# once (11µs+0s) by Class::C3::Componentised::ensure_class_loaded at line 4 | ||||
| 3 | 1 | 5µs | $Tapper::Schema::TestrunDB::ResultSet::Precondition::AUTHORITY = 'cpan:AMD'; | ||
| 4 | 1 | 29µs | 1 | 11µs | } # spent 11µs making 1 call to Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@2 |
| 5 | { | ||||
| 6 | 2 | 1µs | $Tapper::Schema::TestrunDB::ResultSet::Precondition::VERSION = '0.001'; | ||
| 7 | } | ||||
| 8 | |||||
| 9 | 3 | 24µs | 2 | 19µs | # spent 14µs (9+5) within Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@9 which was called:
# once (9µs+5µs) by Class::C3::Componentised::ensure_class_loaded at line 9 # spent 14µs making 1 call to Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@9
# spent 5µs making 1 call to strict::import |
| 10 | 3 | 21µs | 2 | 42µs | # spent 26µs (9+16) within Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@10 which was called:
# once (9µs+16µs) by Class::C3::Componentised::ensure_class_loaded at line 10 # spent 26µs making 1 call to Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@10
# spent 16µs making 1 call to warnings::import |
| 11 | |||||
| 12 | 3 | 21µs | 2 | 94µs | # spent 52µs (9+42) within Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@12 which was called:
# once (9µs+42µs) by Class::C3::Componentised::ensure_class_loaded at line 12 # spent 52µs making 1 call to Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@12
# spent 42µs making 1 call to parent::import |
| 13 | 3 | 149µs | 2 | 122µs | # spent 66µs (9+56) within Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@13 which was called:
# once (9µs+56µs) by Class::C3::Componentised::ensure_class_loaded at line 13 # spent 66µs making 1 call to Tapper::Schema::TestrunDB::ResultSet::Precondition::BEGIN@13
# spent 56µs making 1 call to Exporter::import |
| 14 | |||||
| 15 | |||||
| 16 | sub add { | ||||
| 17 | my ($self, $preconditions) = @_; | ||||
| 18 | |||||
| 19 | my @precond_list = @$preconditions; | ||||
| 20 | my @precond_ids; | ||||
| 21 | |||||
| 22 | foreach my $precond_data (@precond_list) { | ||||
| 23 | # (XXX) decide how to handle empty preconditions | ||||
| 24 | next if not (ref($precond_data) eq 'HASH'); | ||||
| 25 | my $shortname = $precond_data->{shortname} || ''; | ||||
| 26 | my $timeout = $precond_data->{timeout}; | ||||
| 27 | my $precondition = $self->result_source->schema->resultset('Precondition')->new | ||||
| 28 | ({ | ||||
| 29 | shortname => $shortname, | ||||
| 30 | precondition => Dump($precond_data), | ||||
| 31 | timeout => $timeout, | ||||
| 32 | }); | ||||
| 33 | $precondition->insert; | ||||
| 34 | push @precond_ids, $precondition->id; | ||||
| 35 | } | ||||
| 36 | return @precond_ids; | ||||
| 37 | } | ||||
| 38 | |||||
| 39 | 1 | 3µs | 1; | ||
| 40 | |||||
| 41 | __END__ |