Profile of lib/PONAPI/DAO/Request/Role/HasRelationshipType.pm

← 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/Role/HasRelationshipType.pm
Statements | Executed 6 statements in 187µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 18µs | 2.14ms | PONAPI::DAO::Request::Role::HasRelationshipType::::BEGIN@4PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@4
1 | 1 | 1 | 8µs | 86µs | PONAPI::DAO::Request::Role::HasRelationshipType::::BEGIN@26PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@26
0 | 0 | 0 | 0s | 0s | PONAPI::DAO::Request::Role::HasRelationshipType::::_validate_rel_typePONAPI::DAO::Request::Role::HasRelationshipType::_validate_rel_type

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 role - `relationship type`
2 |  |  |  |  | package PONAPI::DAO::Request::Role::HasRelationshipType;
3 |  |  |  |  |
4 | 2 | 132µs | 2 | 4.27ms | # spent 2.14ms (18µs+2.13) within PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@4 which was called: # once (18µs+2.13ms) by Module::Runtime::require_module at line 4 use Moose::Role; # spent 2.14ms making 1 call to PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@4 # spent 2.13ms making 1 call to Moose::Role::import
5 |  |  |  |  |
6 | 1 | 1µs | 1 | 136µs | has rel_type => ( # spent 136µs making 1 call to Moose::Role::has
7 |  |  |  |  | is => 'ro',
8 |  |  |  |  | isa => 'Str',
9 |  |  |  |  | predicate => 'has_rel_type',
10 |  |  |  |  | );
11 |  |  |  |  |
12 |  |  |  |  | sub _validate_rel_type {
13 |  |  |  |  | my ( $self, $args ) = @_;
14 |  |  |  |  |
15 |  |  |  |  | return $self->_bad_request( "`relationship type` is missing for this request" )
16 |  |  |  |  | unless $self->has_rel_type;
17 |  |  |  |  |
18 |  |  |  |  | my $type = $self->type;
19 |  |  |  |  | my $rel_type = $self->rel_type;
20 |  |  |  |  |
21 |  |  |  |  | if ( !$self->repository->has_relationship( $type, $rel_type ) ) {
22 |  |  |  |  | return $self->_bad_request( "Types `$type` and `$rel_type` are not related", 404 )
23 |  |  |  |  | }
24 |  |  |  |  | }
25 |  |  |  |  |
26 | 3 | 54µs | 2 | 164µs | # spent 86µs (8+78) within PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@26 which was called: # once (8µs+78µs) by Module::Runtime::require_module at line 26 no Moose::Role; 1; # spent 86µs making 1 call to PONAPI::DAO::Request::Role::HasRelationshipType::BEGIN@26 # spent 78µs making 1 call to Moose::Role::unimport
27 |  |  |  |  |
28 |  |  |  |  | __END__