[freeside-commits] branch FREESIDE_3_BRANCH updated. 840bcad433cff431da71fbb001092d2605d09f13

Ivan ivan at 420.am
Sun Aug 10 09:43:30 PDT 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  840bcad433cff431da71fbb001092d2605d09f13 (commit)
      from  2322f0123062b8cf2f52aed0a63bb4634cdbaef1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 840bcad433cff431da71fbb001092d2605d09f13
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Aug 10 09:43:29 2014 -0700

    some more status info for CDR processing

diff --git a/httemplate/view/Status.html b/httemplate/view/Status.html
index 019470e..6b1cc6d 100644
--- a/httemplate/view/Status.html
+++ b/httemplate/view/Status.html
@@ -106,13 +106,47 @@ if ( _is_running('cdrd') ) {
                         $s. 's';
 
   }
-
   $status{'CDR Processing'} = [
     { 'title' => 'Current processing delay',
       'value' => $delay,
     },
   ];
 
+  my $pr_delay = FS::Record->scalar_sql('
+    SELECT AVG(end_date-start_date)
+      FROM queue_stat
+      GROUP BY statnum
+      ORDER BY statnum DESC
+      LIMIT 100
+  ');
+  if ( $pr_delay ) {
+    my $h = int($delay/3600);
+    my $m = int( ($delay%3600) / 60 );
+    my $s = $delay%60;
+
+    $pr_delay = ( $h     ? $h. 'h' : '' ).
+                ( $h||$m ? $m. 'm' : '').
+                           $s. 's';
+
+  }
+  $status{'CDR Processing'} = [
+    { 'title' => 'Average billing time',
+      'value' => $pr_delay,
+    },
+  ];
+
+  my $24ago = time2str('%Y-%m-$d %X', time - 86400);
+  my $cdrs = FS::Record->scalar_sql(qq{
+    SELECT COUNT(*) FROM cdr
+      WHERE ( freesidestatus IS NULL OR freesidestatus = '' )
+        AND calldate > '$24ago'
+  });
+  $status{'CDR Processing'} = [
+    { 'title' => 'Unprocessed CDRs',
+      'value' => $cdrs,
+    },
+  ];
+
 }
 
 sub _is_running {

-----------------------------------------------------------------------

Summary of changes:
 httemplate/view/Status.html |   36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list