| Filename | /home/mickey/git_tree/PONAPI/Server/lib/PONAPI/CLI/RunServer.pm |
| Statements | Executed 25 statements in 1.04ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 4.93ms | 7.14ms | PONAPI::CLI::RunServer::BEGIN@7 |
| 1 | 1 | 1 | 1.93ms | 1.42s | PONAPI::CLI::RunServer::BEGIN@9 |
| 1 | 1 | 1 | 545µs | 36.2ms | PONAPI::CLI::RunServer::BEGIN@8 |
| 1 | 1 | 1 | 21µs | 909µs | PONAPI::CLI::RunServer::_create_dir |
| 1 | 1 | 1 | 16µs | 29µs | PONAPI::CLI::RunServer::BEGIN@4 |
| 1 | 1 | 1 | 12µs | 113µs | PONAPI::CLI::RunServer::BEGIN@11 |
| 1 | 1 | 1 | 9µs | 56µs | PONAPI::CLI::RunServer::BEGIN@12 |
| 1 | 1 | 1 | 7µs | 13µs | PONAPI::CLI::RunServer::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | PONAPI::CLI::RunServer::run |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # ABSTRACT: ponapi CLI server runner | ||||
| 2 | package PONAPI::CLI::RunServer; | ||||
| 3 | |||||
| 4 | 2 | 23µs | 2 | 43µ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 # spent 29µs making 1 call to PONAPI::CLI::RunServer::BEGIN@4
# spent 13µs making 1 call to strict::import |
| 5 | 2 | 19µs | 2 | 20µ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 # spent 13µs making 1 call to PONAPI::CLI::RunServer::BEGIN@5
# spent 6µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 2 | 521µs | 1 | 7.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 # spent 7.14ms making 1 call to PONAPI::CLI::RunServer::BEGIN@7 |
| 8 | 2 | 152µs | 1 | 36.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 # spent 36.2ms making 1 call to PONAPI::CLI::RunServer::BEGIN@8 |
| 9 | 2 | 101µs | 1 | 1.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 # spent 1.42s making 1 call to PONAPI::CLI::RunServer::BEGIN@9 |
| 10 | |||||
| 11 | 2 | 34µs | 2 | 214µ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 # spent 113µs making 1 call to PONAPI::CLI::RunServer::BEGIN@11
# spent 101µs making 1 call to Exporter::import |
| 12 | 2 | 133µs | 2 | 103µ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 # spent 56µs making 1 call to PONAPI::CLI::RunServer::BEGIN@12
# spent 47µs making 1 call to Exporter::import |
| 13 | |||||
| 14 | sub run { | ||||
| 15 | 1 | 300ns | my $port = shift; | ||
| 16 | |||||
| 17 | 1 | 900ns | 1 | 909µs | my $dir = _create_dir(); # spent 909µs making 1 call to PONAPI::CLI::RunServer::_create_dir |
| 18 | |||||
| 19 | 1 | 24µs | 3 | 811ms | 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 | |||||
| 26 | 1 | 8µs | 1 | 13µs | my $runner = Plack::Runner->new; # spent 13µs making 1 call to Plack::Runner::new |
| 27 | 1 | 4µs | 1 | 1.87ms | $runner->parse_options( '-port', $port || 5000 ); # spent 1.87ms making 1 call to Plack::Runner::parse_options |
| 28 | 1 | 5µ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 | ||||
| 32 | 1 | 2µs | 1 | 395µs | my $dir = tempdir( CLEANUP => 1 ); # spent 395µs making 1 call to File::Temp::tempdir |
| 33 | |||||
| 34 | 1 | 2µs | 1 | 196µs | my $conf = file( $dir . '/server.yml' ); # spent 196µs making 1 call to Path::Class::file |
| 35 | 1 | 2µs | 1 | 297µs | $conf->spew(<<"DEFAULT_CONF"); # spent 297µs making 1 call to Path::Class::File::spew |
| 36 | server: | ||||
| 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 | |||||
| 44 | repository: | ||||
| 45 | class: "Test::PONAPI::Repository::MockDB" | ||||
| 46 | args: [] | ||||
| 47 | DEFAULT_CONF | ||||
| 48 | |||||
| 49 | 1 | 10µs | return $dir; | ||
| 50 | } | ||||
| 51 | |||||
| 52 | 1 | 2µs | 1; |