| Filename | /home/mickey/git_tree/PONAPI/Server/lib/Test/PONAPI/Repository/MockDB/Table/Articles.pm |
| Statements | Executed 20 statements in 550µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 190790 | 3 | 2 | 127ms | 127ms | Test::PONAPI::Repository::MockDB::Table::Articles::COLUMNS (xsub) |
| 1 | 1 | 1 | 241µs | 38.3ms | Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@5 |
| 1 | 1 | 1 | 22µs | 133µs | Test::PONAPI::Repository::MockDB::Table::Articles::BUILDARGS |
| 1 | 1 | 1 | 18µs | 7.78ms | Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@4 |
| 1 | 1 | 1 | 11µs | 111µs | Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@57 |
| 1 | 1 | 1 | 10µs | 47µs | Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@9 |
| 1 | 1 | 1 | 7µs | 89µs | Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@71 |
| 0 | 0 | 0 | 0s | 0s | Test::PONAPI::Repository::MockDB::Table::Articles::__ANON__[lib/Test/PONAPI/Repository/MockDB/Table/Articles.pm:68] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # ABSTRACT: mock repository - table - Articles | ||||
| 2 | package Test::PONAPI::Repository::MockDB::Table::Articles; | ||||
| 3 | |||||
| 4 | 2 | 61µs | 2 | 15.5ms | # spent 7.78ms (18µs+7.76) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@4 which was called:
# once (18µs+7.76ms) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 4 # spent 7.78ms making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@4
# spent 7.76ms making 1 call to Moose::import |
| 5 | 2 | 151µs | 1 | 38.3ms | # spent 38.3ms (241µs+38.1) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@5 which was called:
# once (241µs+38.1ms) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 5 # spent 38.3ms making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@5 |
| 6 | |||||
| 7 | 1 | 14µs | 1 | 670µs | extends 'Test::PONAPI::Repository::MockDB::Table'; # spent 670µs making 1 call to Moose::extends |
| 8 | |||||
| 9 | 1 | 6µs | 1 | 37µs | # spent 47µs (10+37) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@9 which was called:
# once (10µs+37µs) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 16 # spent 37µs making 1 call to constant::import |
| 10 | id | ||||
| 11 | title | ||||
| 12 | body | ||||
| 13 | created | ||||
| 14 | updated | ||||
| 15 | status | ||||
| 16 | 1 | 120µs | 1 | 47µs | ]]; # spent 47µs making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@9 |
| 17 | |||||
| 18 | # spent 133µs (22+112) within Test::PONAPI::Repository::MockDB::Table::Articles::BUILDARGS which was called:
# once (22µs+112µs) by Test::PONAPI::Repository::MockDB::Table::Articles::new at line 15 of (eval 45)[Eval/Closure.pm:144] | ||||
| 19 | 1 | 500ns | my $class = shift; | ||
| 20 | 1 | 2µs | my %args = @_ == 1 ? %{ $_[0] } : @_; | ||
| 21 | |||||
| 22 | # We could abstract these to their own objects, but no need currently | ||||
| 23 | 1 | 6µs | 1 | 86µs | my $to_comments = # spent 86µs making 1 call to Test::PONAPI::Repository::MockDB::Table::Relationships::new |
| 24 | Test::PONAPI::Repository::MockDB::Table::Relationships->new( | ||||
| 25 | TYPE => 'comments', | ||||
| 26 | TABLE => 'rel_articles_comments', | ||||
| 27 | ID_COLUMN => 'id_articles', | ||||
| 28 | REL_ID_COLUMN => 'id_comments', | ||||
| 29 | COLUMNS => [qw/ id_articles id_comments /], | ||||
| 30 | ONE_TO_ONE => 0, | ||||
| 31 | ); | ||||
| 32 | 1 | 3µs | 1 | 25µs | my $to_authors = # spent 25µs making 1 call to Test::PONAPI::Repository::MockDB::Table::Relationships::new |
| 33 | Test::PONAPI::Repository::MockDB::Table::Relationships->new( | ||||
| 34 | TYPE => 'people', | ||||
| 35 | TABLE => 'rel_articles_people', | ||||
| 36 | ID_COLUMN => 'id_articles', | ||||
| 37 | REL_ID_COLUMN => 'id_people', | ||||
| 38 | COLUMNS => [qw/ id_articles id_people /], | ||||
| 39 | ONE_TO_ONE => 1, | ||||
| 40 | ); | ||||
| 41 | |||||
| 42 | 1 | 4µs | %args = ( | ||
| 43 | TYPE => 'articles', | ||||
| 44 | TABLE => 'articles', | ||||
| 45 | ID_COLUMN => 'id', | ||||
| 46 | COLUMNS => COLUMNS(), | ||||
| 47 | RELATIONS => { | ||||
| 48 | authors => $to_authors, | ||||
| 49 | comments => $to_comments, | ||||
| 50 | }, | ||||
| 51 | %args, | ||||
| 52 | ); | ||||
| 53 | |||||
| 54 | 1 | 6µs | return \%args; | ||
| 55 | } | ||||
| 56 | |||||
| 57 | 2 | 108µs | 2 | 211µs | # spent 111µs (11+100) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@57 which was called:
# once (11µs+100µs) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 57 # spent 111µs making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@57
# spent 100µs making 1 call to Exporter::import |
| 58 | override update_stmt => sub { | ||||
| 59 | my ($self, %args) = @_; | ||||
| 60 | |||||
| 61 | my $values = $args{values} || {}; | ||||
| 62 | my $copy = { %$values }; | ||||
| 63 | $copy->{updated} = \'CURRENT_TIMESTAMP'; | ||||
| 64 | |||||
| 65 | my ($stmt, $ret, $msg) = $self->SUPER::update_stmt(%args, values => $copy); | ||||
| 66 | $ret ||= PONAPI_UPDATED_EXTENDED; | ||||
| 67 | return $stmt, $ret, $msg; | ||||
| 68 | 1 | 3µs | 1 | 320µs | }; # spent 320µs making 1 call to Moose::override |
| 69 | |||||
| 70 | 1 | 5µs | 2 | 4.26ms | __PACKAGE__->meta->make_immutable; # spent 4.25ms making 1 call to Class::MOP::Class::make_immutable
# spent 12µs making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::meta |
| 71 | 3 | 61µs | 2 | 170µs | # spent 89µs (7+82) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@71 which was called:
# once (7µs+82µs) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 71 # spent 89µs making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@71
# spent 82µs making 1 call to Moose::unimport |
| 72 | |||||
| 73 | __END__ | ||||
# spent 127ms within Test::PONAPI::Repository::MockDB::Table::Articles::COLUMNS which was called 190790 times, avg 664ns/call:
# 92337 times (73.3ms+0s) by Test::PONAPI::Repository::MockDB::Table::_stmt_filters at line 162 of lib/Test/PONAPI/Repository/MockDB/Table.pm, avg 794ns/call
# 76057 times (30.9ms+0s) by Test::PONAPI::Repository::MockDB::Table::_stmt_columns at line 144 of lib/Test/PONAPI/Repository/MockDB/Table.pm, avg 406ns/call
# 22396 times (22.5ms+0s) by Test::PONAPI::Repository::MockDB::type_has_fields at line 76 of lib/Test/PONAPI/Repository/MockDB.pm, avg 1µs/call |