Ver código fonte

ims_charging: Add statistic ccr_timeouts

Carsten Bock 12 anos atrás
pai
commit
a39adb3497

+ 17 - 8
modules/ims_charging/README

@@ -75,8 +75,11 @@ Carlos Ruiz Diaz
               6.9. Failed final CCRs (failed_final_ccrs)
               6.10. CCRs average response time (ccr_avg_response_time)
               6.11. CCRs responses time (ccr_responses_time)
-              6.12. Billed seconds (billed_secs)
-              6.13. Killed calls (killed_calls)
+              6.12. CCRs requests, which ended with a timeout
+                      (ccr_timeouts)
+
+              6.13. Billed seconds (billed_secs)
+              6.14. Killed calls (killed_calls)
 
    List of Examples
 
@@ -155,8 +158,9 @@ Chapter 1. Admin Guide
         6.9. Failed final CCRs (failed_final_ccrs)
         6.10. CCRs average response time (ccr_avg_response_time)
         6.11. CCRs responses time (ccr_responses_time)
-        6.12. Billed seconds (billed_secs)
-        6.13. Killed calls (killed_calls)
+        6.12. CCRs requests, which ended with a timeout (ccr_timeouts)
+        6.13. Billed seconds (billed_secs)
+        6.14. Killed calls (killed_calls)
 
 1. Overview
 
@@ -645,8 +649,9 @@ n");
    6.9. Failed final CCRs (failed_final_ccrs)
    6.10. CCRs average response time (ccr_avg_response_time)
    6.11. CCRs responses time (ccr_responses_time)
-   6.12. Billed seconds (billed_secs)
-   6.13. Killed calls (killed_calls)
+   6.12. CCRs requests, which ended with a timeout (ccr_timeouts)
+   6.13. Billed seconds (billed_secs)
+   6.14. Killed calls (killed_calls)
 
 6.1. Initial CCRs (initial_ccrs)
 
@@ -696,10 +701,14 @@ n");
 
    Total CCA arrival time in milliseconds.
 
-6.12. Billed seconds (billed_secs)
+6.12. CCRs requests, which ended with a timeout (ccr_timeouts)
+
+   Number of CCR-Requests, which ran into an timeout.
+
+6.13. Billed seconds (billed_secs)
 
    Number of seconds billed in total.
 
-6.13. Killed calls (killed_calls)
+6.14. Killed calls (killed_calls)
 
    Number of calls that were killed due to lack of credit.

+ 4 - 0
modules/ims_charging/doc/ims_charging_admin.xml

@@ -633,6 +633,10 @@ route[CHARGING_CCR_REPLY]
       <title>CCRs responses time (ccr_responses_time)</title>
       <para>Total CCA arrival time in milliseconds.</para>
     </section>
+    <section>
+      <title>CCRs requests, which ended with a timeout (ccr_timeouts)</title>
+      <para>Number of CCR-Requests, which ran into an timeout.</para>
+    </section>
     <section>
       <title>Billed seconds (billed_secs)</title>
       <para>Number of seconds billed in total.</para>

+ 20 - 1
modules/ims_charging/ims_ro.c

@@ -651,6 +651,12 @@ static void resume_on_interim_ccr(int is_timeout, void *param, AAAMessage *cca,
 	struct interim_ccr *i_req	= (struct interim_ccr *) param;
 	Ro_CCA_t * ro_cca_data = NULL;
 
+    if (is_timeout) {
+        update_stat(ccr_timeouts, 1);
+        LM_ERR("Transaction timeout - did not get CCA\n");
+        goto error;
+    }
+
     update_stat(ccr_responses_time, elapsed_msecs);
 
 	if (!i_req) {
@@ -833,6 +839,12 @@ error0:
 static void resume_on_termination_ccr(int is_timeout, void *param, AAAMessage *cca, long elapsed_msecs) {
     Ro_CCA_t *ro_cca_data = NULL;
 
+    if (is_timeout) {
+        update_stat(ccr_timeouts, 1);
+        LM_ERR("Transaction timeout - did not get CCA\n");
+        goto error;
+    }
+
     update_stat(ccr_responses_time, elapsed_msecs);
 
     if (!cca) {
@@ -1021,6 +1033,13 @@ static void resume_on_initial_ccr(int is_timeout, void *param, AAAMessage *cca,
     struct session_setup_data *ssd = (struct session_setup_data *) param;
     int error_code	= RO_RETURN_ERROR;
 
+    if (is_timeout) {
+        update_stat(ccr_timeouts, 1);
+        LM_ERR("Transaction timeout - did not get CCA\n");
+	error_code =  RO_RETURN_ERROR;
+        goto error0;
+    }
+
     update_stat(ccr_responses_time, elapsed_msecs);
 
     if (!cca) {
@@ -1039,7 +1058,7 @@ static void resume_on_initial_ccr(int is_timeout, void *param, AAAMessage *cca,
 	if (tmb.t_lookup_ident(&t, ssd->tindex, ssd->tlabel) < 0) {
 		LM_ERR("t_continue: transaction not found\n");
 		error_code	= RO_RETURN_ERROR;
-		goto error1;
+		goto error0;
 	}
 
 	// we bring the list of AVPs of the transaction to the current context

+ 2 - 0
modules/ims_charging/mod.c

@@ -60,6 +60,7 @@ stat_var *successful_final_ccrs;
 stat_var *ccr_responses_time;
 stat_var *billed_secs;
 stat_var *killed_calls;
+stat_var *ccr_timeouts;
 
 /** module functions */
 static int mod_init(void);
@@ -113,6 +114,7 @@ stat_export_t charging_stats[] = {
     {"ccr_responses_time", STAT_NO_RESET, &ccr_responses_time},
     {"billed_secs", STAT_NO_RESET, &billed_secs},
     {"killed_calls", STAT_NO_RESET, &killed_calls},
+    {"ccr_timeouts", STAT_NO_RESET, &ccr_timeouts},
     {0, 0, 0}
 };
 

+ 1 - 0
modules/ims_charging/stats.h

@@ -19,6 +19,7 @@ extern stat_var *successful_final_ccrs;
 extern stat_var *ccr_responses_time;
 extern stat_var *billed_secs;
 extern stat_var *killed_calls;
+extern stat_var *ccr_timeouts;
 
 unsigned long get_failed_initial_ccrs();
 unsigned long get_failed_interim_ccrs();