[Dbix-class] using DBIx::Class::Storage::Statistics per the Cookbook

Nathan Kurz nate at verse.com
Mon Aug 7 08:27:10 CEST 2006


I'm trying to get some query statistics using the methods suggested in
DBIx::Class::Manual::Cookbook, but I haven't had any success yet.  
When I try adding the lines: 

  __PACKAGE__->storage()->debugobj(new My::Profiler());
  __PACKAGE__->storage()->debug(1);

to my schema class file, Catalyst refuses to start with the message:

  "Can't call method "debugobj" on an undefined value"

I think this is because 'storage' is not created until the connection
is established.  Is there somewhere else I should be adding those
lines other than the schema class, or some way to delay the action?

Thanks!

Nathan Kurz
nate at verse.com

(following is a related tiny patch to the example in the cookbook)
----------------------------------------------------------------------------
--- DBIx/Class/Manual/Cookbook.pod~      2006-07-25 23:23:44.000000000 -0600
+++ DBIx/Class/Manual/Cookbook.pod       2006-08-06 23:56:01.000000000 -0600
@@ -821,7 +821,7 @@
   sub query_start {
     my $self = shift();
     my $sql = shift();
-    my $params = @_;
+    my @params = @_;
 
     print "Executing $sql: ".join(', ', @params)."\n";
     $start = time();



More information about the Dbix-class mailing list