← 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/Create.pm
StatementsExecuted 8 statements in 240µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11118µs3.08msPONAPI::DAO::Request::Create::::BEGIN@4PONAPI::DAO::Request::Create::BEGIN@4
1118µs93µsPONAPI::DAO::Request::Create::::BEGIN@38PONAPI::DAO::Request::Create::BEGIN@38
0000s0sPONAPI::DAO::Request::Create::::executePONAPI::DAO::Request::Create::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 - create
2package PONAPI::DAO::Request::Create;
3
42186µs26.14ms
# spent 3.08ms (18µs+3.06) within PONAPI::DAO::Request::Create::BEGIN@4 which was called: # once (18µs+3.06ms) by PONAPI::DAO::BEGIN@10 at line 4
use Moose;
# spent 3.08ms making 1 call to PONAPI::DAO::Request::Create::BEGIN@4 # spent 3.06ms making 1 call to Moose::import
5
611µs1588µsextends 'PONAPI::DAO::Request';
# spent 588µs making 1 call to Moose::extends
7
812µs116.6mswith 'PONAPI::DAO::Request::Role::HasData',
# spent 16.6ms making 1 call to Moose::with
9 'PONAPI::DAO::Request::Role::HasDataMethods';
10
11sub execute {
12 my $self = shift;
13 my $doc = $self->document;
14
15 my @headers;
16 if ( $self->is_valid ) {
17 $self->repository->create( %{ $self } );
18 $doc->add_meta(
19 detail => "successfully created the resource: "
20 . $self->type
21 . " => "
22 . $self->json->encode( $self->data )
23 );
24
25 $doc->set_status(201) unless $doc->has_status;
26
27 my $document = $doc->build;
28 my $self_link = $document->{data}{links}{self};
29 $self_link //= "/$document->{data}{type}/$document->{data}{id}";
30
31 push @headers, Location => $self_link;
32 }
33
34 return $self->response( @headers );
35}
36
3715µs210.1ms__PACKAGE__->meta->make_immutable;
# spent 10.1ms making 1 call to Class::MOP::Class::make_immutable # spent 13µs making 1 call to PONAPI::DAO::Request::Create::meta
38345µs2178µs
# spent 93µs (8+85) within PONAPI::DAO::Request::Create::BEGIN@38 which was called: # once (8µs+85µs) by PONAPI::DAO::BEGIN@10 at line 38
no Moose; 1;
# spent 93µs making 1 call to PONAPI::DAO::Request::Create::BEGIN@38 # spent 85µs making 1 call to Moose::unimport
39
40__END__