Author: spadkins
Date: Wed Dec 2 11:59:09 2009
New Revision: 13625
Modified:
p5ee/trunk/App-WorkQueue/lib/App/WorkQueue.pm
p5ee/trunk/App-WorkQueue/lib/App/WorkQueue/Repository.pm
Log:
updated to remove some logging code, and to add some additional poe_profile
statements
Modified: p5ee/trunk/App-WorkQueue/lib/App/WorkQueue.pm
==============================================================================
--- p5ee/trunk/App-WorkQueue/lib/App/WorkQueue.pm (original)
+++ p5ee/trunk/App-WorkQueue/lib/App/WorkQueue.pm Wed Dec 2 11:59:09 2009
@@ -553,9 +553,12 @@
}
}
}
- if (!$entry) {
- $context->log({level=>2}, "$self->{name} : _acquire_in_mem:
undef\n");
- }
+ ### This has been getting logged way too much,
+ ### turns out this situation happens when we can't get a resource_key
allocation
+ ### for any entry because the throttles are all full
+ #if (!$entry) {
+ # $context->log({level=>2}, "$self->{name} : _acquire_in_mem:
undef\n");
+ #}
}
&App::sub_exit($entry) if ($App::trace);
@@ -1005,16 +1008,18 @@
my ($entry, %event);
while ($num_events < $max_events) {
$entry = $self->acquire();
- ### TODO: is there a chance that this fails?, and should we bail
if it does?
+ ### $entry will be undef if we don't have any entries with
throttle (resource) availability
last if (!$entry);
$num_events++;
%event = %{$self->{acquisition_event}};
- ### TODO: figure out how to abstract out the industry part of
this!!!
- #$event{args} = [ $self->{acquisition_event}{industry}, $entry ];
+ ### TODO: figure out how to abstract out the app_type part of
this!!!
+ #$event{args} = [ $self->{acquisition_event}{app_type}, $entry ];
if ($event_args) {
$event{args} = [ $entry, $event_args ];
}
+ $context->profile_start(sprintf("dispatch_events : %s %s",
$event{name}, $event{method})) if $context->{poe_profile};
$context->send_event(\%event);
+ $context->profile_stop(sprintf("dispatch_events : %s %s",
$event{name}, $event{method})) if $context->{poe_profile};
}
}
&App::sub_exit($num_events) if ($App::trace);
Modified: p5ee/trunk/App-WorkQueue/lib/App/WorkQueue/Repository.pm
==============================================================================
--- p5ee/trunk/App-WorkQueue/lib/App/WorkQueue/Repository.pm (original)
+++ p5ee/trunk/App-WorkQueue/lib/App/WorkQueue/Repository.pm Wed Dec 2
11:59:09 2009
@@ -101,9 +101,12 @@
&App::sub_entry if ($App::trace);
my ($self) = @_;
my $context = $self->{context};
- $context->log({level=>4},"$self->{name} _refresh_queue\n");
+ $context->profile_start("_refresh_queue : _refresh_status_counts") if
$context->{poe_profile};
$self->_refresh_status_counts();
+ $context->profile_stop("_refresh_queue : _refresh_status_counts") if
$context->{poe_profile};
+ $context->profile_start("_refresh_queue : _refresh_resource_counts") if
$context->{poe_profile};
$self->_refresh_resource_counts();
+ $context->profile_stop("_refresh_queue : _refresh_resource_counts") if
$context->{poe_profile};
#$self->_maintain_queue_buffers();
&App::sub_exit() if ($App::trace);
}