← 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:09 2016

Filename/home/mickey/git_tree/PONAPI/Server/lib/PONAPI/CLI/RunServer.pm
StatementsExecuted 25 statements in 1.04ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1114.93ms7.14msPONAPI::CLI::RunServer::::BEGIN@7PONAPI::CLI::RunServer::BEGIN@7
1111.93ms1.42sPONAPI::CLI::RunServer::::BEGIN@9PONAPI::CLI::RunServer::BEGIN@9
111545µs36.2msPONAPI::CLI::RunServer::::BEGIN@8PONAPI::CLI::RunServer::BEGIN@8
11121µs909µsPONAPI::CLI::RunServer::::_create_dirPONAPI::CLI::RunServer::_create_dir
11116µs29µsPONAPI::CLI::RunServer::::BEGIN@4PONAPI::CLI::RunServer::BEGIN@4
11112µs113µsPONAPI::CLI::RunServer::::BEGIN@11PONAPI::CLI::RunServer::BEGIN@11
1119µs56µsPONAPI::CLI::RunServer::::BEGIN@12PONAPI::CLI::RunServer::BEGIN@12
1117µs13µsPONAPI::CLI::RunServer::::BEGIN@5PONAPI::CLI::RunServer::BEGIN@5
0000s0sPONAPI::CLI::RunServer::::runPONAPI::CLI::RunServer::run
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# ABSTRACT: ponapi CLI server runner
2package PONAPI::CLI::RunServer;
3
4223µs243µs
# spent 29µs (16+13) within PONAPI::CLI::RunServer::BEGIN@4 which was called: # once (16µs+13µs) by PONAPI::CLI::Command::demo::run_server at line 4
use strict;
# spent 29µs making 1 call to PONAPI::CLI::RunServer::BEGIN@4 # spent 13µs making 1 call to strict::import
5219µs220µs
# spent 13µs (7+6) within PONAPI::CLI::RunServer::BEGIN@5 which was called: # once (7µs+6µs) by PONAPI::CLI::Command::demo::run_server at line 5
use warnings;
# spent 13µs making 1 call to PONAPI::CLI::RunServer::BEGIN@5 # spent 6µs making 1 call to warnings::import
6
72521µs17.14ms
# spent 7.14ms (4.93+2.21) within PONAPI::CLI::RunServer::BEGIN@7 which was called: # once (4.93ms+2.21ms) by PONAPI::CLI::Command::demo::run_server at line 7
use Plack::Runner;
# spent 7.14ms making 1 call to PONAPI::CLI::RunServer::BEGIN@7
82152µs136.2ms
# spent 36.2ms (545µs+35.7) within PONAPI::CLI::RunServer::BEGIN@8 which was called: # once (545µs+35.7ms) by PONAPI::CLI::Command::demo::run_server at line 8
use Plack::Middleware::MethodOverride;
# spent 36.2ms making 1 call to PONAPI::CLI::RunServer::BEGIN@8
92101µs11.42s
# spent 1.42s (1.93ms+1.42) within PONAPI::CLI::RunServer::BEGIN@9 which was called: # once (1.93ms+1.42s) by PONAPI::CLI::Command::demo::run_server at line 9
use PONAPI::Server;
# spent 1.42s making 1 call to PONAPI::CLI::RunServer::BEGIN@9
10
11234µs2214µs
# spent 113µs (12+101) within PONAPI::CLI::RunServer::BEGIN@11 which was called: # once (12µs+101µs) by PONAPI::CLI::Command::demo::run_server at line 11
use File::Temp qw( tempdir );
# spent 113µs making 1 call to PONAPI::CLI::RunServer::BEGIN@11 # spent 101µs making 1 call to Exporter::import
122133µs2103µs
# spent 56µs (9+47) within PONAPI::CLI::RunServer::BEGIN@12 which was called: # once (9µs+47µs) by PONAPI::CLI::Command::demo::run_server at line 12
use Path::Class qw( file );
# spent 56µs making 1 call to PONAPI::CLI::RunServer::BEGIN@12 # spent 47µs making 1 call to Exporter::import
13
14sub run {
151300ns my $port = shift;
16
171900ns1909µs my $dir = _create_dir();
# spent 909µs making 1 call to PONAPI::CLI::RunServer::_create_dir
18
19124µs3811ms my $app = Plack::Middleware::MethodOverride->wrap(
# spent 811ms making 1 call to Plack::Component::to_app # spent 228µs making 1 call to Plack::Middleware::wrap # spent 7µs making 1 call to Plack::Component::new
20 PONAPI::Server->new(
21 'repository.class' => 'Test::PONAPI::Repository::MockDB',
22 'ponapi.config_dir' => $dir
23 )->to_app()
24 );
25
2618µs113µs my $runner = Plack::Runner->new;
# spent 13µs making 1 call to Plack::Runner::new
2714µs11.87ms $runner->parse_options( '-port', $port || 5000 );
# spent 1.87ms making 1 call to Plack::Runner::parse_options
2815µs $runner->run($app);
29}
30
31
# spent 909µs (21+888) within PONAPI::CLI::RunServer::_create_dir which was called: # once (21µs+888µs) by PONAPI::CLI::RunServer::run at line 17
sub _create_dir {
3212µs1395µs my $dir = tempdir( CLEANUP => 1 );
# spent 395µs making 1 call to File::Temp::tempdir
33
3412µs1196µs my $conf = file( $dir . '/server.yml' );
# spent 196µs making 1 call to Path::Class::file
3512µs1297µs $conf->spew(<<"DEFAULT_CONF");
# spent 297µs making 1 call to Path::Class::File::spew
36server:
37 spec_version: "1.0"
38 sort_allowed: "true"
39 send_version_header: "true"
40 send_document_self_link: "true"
41 links_type: "relative"
42 respond_to_updates_with_200: "false"
43
44repository:
45 class: "Test::PONAPI::Repository::MockDB"
46 args: []
47DEFAULT_CONF
48
49110µs return $dir;
50}
51
5212µs1;