add support for db profiling, RT#5662
authorivan <ivan>
Wed, 24 Jun 2009 18:36:32 +0000 (18:36 +0000)
committerivan <ivan>
Wed, 24 Jun 2009 18:36:32 +0000 (18:36 +0000)
FS/bin/freeside-queued
init.d/freeside-init

index 2188dd4..22fd7bb 100644 (file)
@@ -157,6 +157,8 @@ while (1) {
 
       forksuidsetup($user);
 
+      dbh->{'private_profile'} = {} if UNIVERSAL::can(dbh, 'sprintProfile');
+
       #auto-use classes...
       if (    $ljob->job =~ /(FS::(part_export|cust_main)::\w+)::/
            || $ljob->job =~ /(FS::\w+)::/
@@ -191,6 +193,13 @@ while (1) {
         $ljob->delete;
       }
 
+      if ( UNIVERSAL::can(dbh, 'sprintProfile') ) {
+        open(PROFILE,">%%%FREESIDE_LOG%%%/queueprofile.$$.".time)
+          or die "can't open profile file: $!";
+        print PROFILE dbh->sprintProfile();
+        close PROFILE or die "can't close profile file: $!";
+      }
+
       exit;
       #end-of-kid
     }
index c9bcebe..4e58b32 100644 (file)
@@ -18,6 +18,7 @@ case "$1" in
   start)
         # Start daemons.
         echo -n "Starting freeside-queued: "
+        #perl -MDBIx::Profile /usr/local/bin/freeside-queued $QUEUED_USER
         freeside-queued $QUEUED_USER
         echo "done."