← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:11 2016

Filename/home/mickey/git_tree/PONAPI/Server/lib/PONAPI/DAO/Request/DeleteRelationships.pm
StatementsExecuted 8 statements in 321µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11118µs3.18msPONAPI::DAO::Request::DeleteRelationships::::BEGIN@4PONAPI::DAO::Request::DeleteRelationships::BEGIN@4
1119µs93µsPONAPI::DAO::Request::DeleteRelationships::::BEGIN@47PONAPI::DAO::Request::DeleteRelationships::BEGIN@47
0000s0sPONAPI::DAO::Request::DeleteRelationships::::_validate_rel_typePONAPI::DAO::Request::DeleteRelationships::_validate_rel_type
0000s0sPONAPI::DAO::Request::DeleteRelationships::::check_data_type_matchPONAPI::DAO::Request::DeleteRelationships::check_data_type_match
0000s0sPONAPI::DAO::Request::DeleteRelationships::::executePONAPI::DAO::Request::DeleteRelationships::execute
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# ABSTRACT: DAO request - delete relationships
2package PONAPI::DAO::Request::DeleteRelationships;
3
42251µs26.34ms
# spent 3.18ms (18µs+3.16) within PONAPI::DAO::Request::DeleteRelationships::BEGIN@4 which was called: # once (18µs+3.16ms) by PONAPI::DAO::BEGIN@15 at line 4
use Moose;
# spent 3.18ms making 1 call to PONAPI::DAO::Request::DeleteRelationships::BEGIN@4 # spent 3.16ms making 1 call to Moose::import
5
6114µs1628µsextends 'PONAPI::DAO::Request';
# spent 628µs making 1 call to Moose::extends
7
814µs122.2mswith 'PONAPI::DAO::Request::Role::UpdateLike',
# spent 22.2ms making 1 call to Moose::with
9 'PONAPI::DAO::Request::Role::HasDataBulk',
10 'PONAPI::DAO::Request::Role::HasDataMethods',
11 'PONAPI::DAO::Request::Role::HasID',
12 'PONAPI::DAO::Request::Role::HasRelationshipType';
13
14sub check_data_type_match { 1 } # to avoid code duplications in HasDataMethods
15
16sub execute {
17 my $self = shift;
18
19 if ( $self->is_valid ) {
20 my @ret = $self->repository->delete_relationships( %{ $self } );
21
22 $self->_add_success_meta(@ret)
23 if $self->_verify_update_response(@ret);
24 }
25
26 return $self->response();
27}
28
29sub _validate_rel_type {
30 my ( $self, $args ) = @_;
31
32 return $self->_bad_request( "`relationship type` is missing for this request" )
33 unless $self->has_rel_type;
34
35 my $type = $self->type;
36 my $rel_type = $self->rel_type;
37
38 return $self->_bad_request( "Types `$type` and `$rel_type` are not related", 404 )
39 unless $self->repository->has_relationship( $type, $rel_type );
40
41 return $self->_bad_request( "Types `$type` and `$rel_type` are one-to-one" )
42 unless $self->repository->has_one_to_many_relationship( $type, $rel_type );
43}
44
45
4614µs29.97ms__PACKAGE__->meta->make_immutable;
# spent 9.95ms making 1 call to Class::MOP::Class::make_immutable # spent 22µs making 1 call to PONAPI::DAO::Request::DeleteRelationships::meta
47348µs2177µs
# spent 93µs (9+84) within PONAPI::DAO::Request::DeleteRelationships::BEGIN@47 which was called: # once (9µs+84µs) by PONAPI::DAO::BEGIN@15 at line 47
no Moose; 1;
# spent 93µs making 1 call to PONAPI::DAO::Request::DeleteRelationships::BEGIN@47 # spent 84µs making 1 call to Moose::unimport
48
49__END__