Author: spadkins
Date: Thu Dec 20 09:00:40 2007
New Revision: 10444
Modified:
p5ee/trunk/App-Context/lib/App/Context/POE/ClusterController.pm
p5ee/trunk/App-Context/lib/App/Context/POE/ClusterNode.pm
p5ee/trunk/App-Context/lib/App/Context/POE/Server.pm
Log:
added some POE tracing code, to get us stats about what is so slow
Modified: p5ee/trunk/App-Context/lib/App/Context/POE/ClusterController.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/Context/POE/ClusterController.pm
(original)
+++ p5ee/trunk/App-Context/lib/App/Context/POE/ClusterController.pm Thu Dec
20 09:00:40 2007
@@ -12,6 +12,8 @@
@ISA = ( "App::Context::POE::Server" );
use Date::Format;
+#sub POE::Kernel::TRACE_STATISTICS () { 1 }
+#sub POE::Kernel::TRACE_PROFILE () { 1 }
use POE;
use strict;
Modified: p5ee/trunk/App-Context/lib/App/Context/POE/ClusterNode.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/Context/POE/ClusterNode.pm (original)
+++ p5ee/trunk/App-Context/lib/App/Context/POE/ClusterNode.pm Thu Dec 20
09:00:40 2007
@@ -15,6 +15,8 @@
use Date::Format;
+#sub POE::Kernel::TRACE_STATISTICS () { 1 }
+#sub POE::Kernel::TRACE_PROFILE () { 1 }
use POE;
use POE::Component::IKC::Client;
use POE::Component::IKC::Responder;
Modified: p5ee/trunk/App-Context/lib/App/Context/POE/Server.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/Context/POE/Server.pm (original)
+++ p5ee/trunk/App-Context/lib/App/Context/POE/Server.pm Thu Dec 20
09:00:40 2007
@@ -19,13 +19,11 @@
use Date::Parse;
use Time::HiRes qw(gettimeofday tv_interval);
+#sub POE::Kernel::TRACE_STATISTICS () { 1 }
+#sub POE::Kernel::TRACE_PROFILE () { 1 }
use POE;
use POE::Component::Server::SimpleHTTP;
use POE::Component::IKC::Server;
-### This doesn't help us much, and is a pain with
-### a lot of CPAN dependencies, so commenting it out
-#use POE::API::Peek;
-#App->use("POE::API::Peek");
use HTTP::Status qw/RC_OK/;
use Socket qw(INADDR_ANY);
use Data::Dumper;
@@ -347,7 +345,7 @@
}
sub _state_poe {
- my $self = @_;
+ my ($self) = @_;
my $state = "";
### POE state dumping - Currently commented out because it doesn't gain us
much
@@ -948,6 +946,14 @@
my $sec_until_next_event = $time_of_next_event - $time;
$self->{alarm_id} = $kernel->delay_set("poe_alarm", $sec_until_next_event);
+ ### call some POE profile dump functions, only happens when ENV variables
+ ### POE_TRACE_PROFILE=1 POE_TRACE_STATISTICS=1
+ my %data = $kernel->stat_getdata();
+ for my $key (sort keys %data) {
+ $self->log("POE: poe_alarm : poe_statistics [" . sprintf("%20s : %s",
$key, $data{$key}) . "]\n");
+ }
+ $kernel->stat_show_profile();
+
$self->log("POE: poe_alarm exit : events_occurred[$events_occurred]
sec_until_next_event[$sec_until_next_event]\n") if $self->{options}{poe_trace};
&App::sub_exit() if ($App::trace);
}