← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:36 2012

Filename/2home/ss5/local/projects/Tapper/src/Tapper-MCP/lib/Tapper/MCP/Scheduler/Algorithm/WFQ.pm
StatementsExecuted 14491 statements in 22.3ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
4771113.3ms48.1msTapper::MCP::Scheduler::Algorithm::WFQ::::lookup_next_queueTapper::MCP::Scheduler::Algorithm::WFQ::lookup_next_queue
1448119.83ms23.8msTapper::MCP::Scheduler::Algorithm::WFQ::::get_virtual_finishing_timeTapper::MCP::Scheduler::Algorithm::WFQ::get_virtual_finishing_time
109113.60ms12.0sTapper::MCP::Scheduler::Algorithm::WFQ::::update_queueTapper::MCP::Scheduler::Algorithm::WFQ::update_queue
11154µs107µsTapper::MCP::Scheduler::Algorithm::WFQ::::BEGIN@6Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@6
11125µs2.91msTapper::MCP::Scheduler::Algorithm::WFQ::::BEGIN@5Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@5
1119µs53µsTapper::MCP::Scheduler::Algorithm::WFQ::::BEGIN@6.16Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@6.16
0000s0sTapper::MCP::Scheduler::Algorithm::WFQ::::get_next_queueTapper::MCP::Scheduler::Algorithm::WFQ::get_next_queue
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1## no critic (RequireUseStrict)
2package Tapper::MCP::Scheduler::Algorithm::WFQ;
3# ABSTRACT: Scheduling algorithm "Weighted Fair Queueing"
4
5353µs25.79ms
# spent 2.91ms (25µs+2.88) within Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@5 which was called: # once (25µs+2.88ms) by main::BEGIN@1.15 at line 5
use Moose::Role;
# spent 2.91ms making 1 call to Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@5 # spent 2.88ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:492]
66308µs3203µs
# spent 107µs (54+53) within Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@6 which was called: # once (54µs+53µs) by main::BEGIN@1.15 at line 6 # spent 53µs (9+43) within Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@6.16 which was called: # once (9µs+43µs) by Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@6 at line 6
use 5.010;
# spent 107µs making 1 call to Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@6 # spent 53µs making 1 call to Tapper::MCP::Scheduler::Algorithm::WFQ::BEGIN@6.16 # spent 44µs making 1 call to feature::import
712µs178µs requires 'queues';
# spent 78µs making 1 call to Moose::Role::requires
8
9# use aliased 'Tapper::Schema::TestrunDB::Result::Queue';
10
11
# spent 23.8ms (9.83+14.0) within Tapper::MCP::Scheduler::Algorithm::WFQ::get_virtual_finishing_time which was called 1448 times, avg 16µs/call: # 1448 times (9.83ms+14.0ms) by Tapper::MCP::Scheduler::Algorithm::WFQ::lookup_next_queue at line 30, avg 16µs/call
sub get_virtual_finishing_time {
1243448.20ms my ($self, $queue) = @_;
13
1414486.19ms my $prio = $queue->priority || 1;
# spent 6.19ms making 1448 calls to Tapper::Schema::TestrunDB::Result::Queue::priority, avg 4µs/call
1514487.81ms return ($queue->runcount + 1.0) / $prio;
# spent 7.81ms making 1448 calls to Tapper::Schema::TestrunDB::Result::Queue::runcount, avg 5µs/call
16 }
17
18
19
# spent 48.1ms (13.3+34.7) within Tapper::MCP::Scheduler::Algorithm::WFQ::lookup_next_queue which was called 477 times, avg 101µs/call: # 477 times (13.3ms+34.7ms) by Tapper::MCP::Scheduler::Controller::get_next_job at line 93 of lib/Tapper/MCP/Scheduler/Controller.pm, avg 101µs/call
sub lookup_next_queue {
20980911.0ms my ($self, $queues) = @_;
21
22 my $vft;
23 my $queue;
24
25 foreach my $q (values %$queues)
26 {
27 my $this_vft;
28144810.9ms next if not $q->priority;
# spent 10.9ms making 1448 calls to Tapper::Schema::TestrunDB::Result::Queue::priority, avg 8µs/call
29
30144823.8ms $this_vft = $self->get_virtual_finishing_time($q);
# spent 23.8ms making 1448 calls to Tapper::MCP::Scheduler::Algorithm::WFQ::get_virtual_finishing_time, avg 16µs/call
31
32 if (not defined $vft)
33 {
34 $vft = $this_vft;
35 $queue = $q;
36 }
37 elsif ($vft > $this_vft)
38 {
39 $vft = $this_vft;
40 $queue = $q;
41 }
42 }
43 return $queue;
44 }
45
- -
48 sub get_next_queue
49 {
50 my ($self) = @_;
51
52 my $vft;
53 my $queue = $self->lookup_next_queue($self->queues);
54 $self->update_queue($queue);
55 return $queue;
56 }
57
58
# spent 12.0s (3.60ms+12.0) within Tapper::MCP::Scheduler::Algorithm::WFQ::update_queue which was called 109 times, avg 110ms/call: # 109 times (3.60ms+12.0s) by Tapper::MCP::Scheduler::Controller::get_next_job at line 107 of lib/Tapper/MCP/Scheduler/Controller.pm, avg 110ms/call
sub update_queue {
593272.81ms my ($self, $q) = @_;
60
6121842.6ms $q->runcount ( $q->runcount + 1 );
# spent 42.6ms making 218 calls to Tapper::Schema::TestrunDB::Result::Queue::runcount, avg 195µs/call
6210912.0s $q->update;
# spent 12.0s making 109 calls to DBIx::Class::Relationship::CascadeActions::update, avg 110ms/call
63 }
64
6514µs1;
66
67__END__