[freeside-commits] branch master updated. 1183e25b1f1da42774fb8d51f9f6b808ef7fad2b

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


The branch, master has been updated
       via  1183e25b1f1da42774fb8d51f9f6b808ef7fad2b (commit)
      from  d883a843dcfce64caeddd2a4abb0982c16a17199 (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 1183e25b1f1da42774fb8d51f9f6b808ef7fad2b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Aug 10 09:43:28 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