Browse code

ims_charging: Add statistic ccr_timeouts

Carsten Bock authored on 07/10/2013 14:17:53
Showing 5 changed files
... ...
@@ -75,8 +75,11 @@ Carlos Ruiz Diaz
75 75
               6.9. Failed final CCRs (failed_final_ccrs)
76 76
               6.10. CCRs average response time (ccr_avg_response_time)
77 77
               6.11. CCRs responses time (ccr_responses_time)
78
-              6.12. Billed seconds (billed_secs)
79
-              6.13. Killed calls (killed_calls)
78
+              6.12. CCRs requests, which ended with a timeout
79
+                      (ccr_timeouts)
80
+
81
+              6.13. Billed seconds (billed_secs)
82
+              6.14. Killed calls (killed_calls)
80 83
 
81 84
    List of Examples
82 85
 
... ...
@@ -155,8 +158,9 @@ Chapter 1. Admin Guide
155 155
         6.9. Failed final CCRs (failed_final_ccrs)
156 156
         6.10. CCRs average response time (ccr_avg_response_time)
157 157
         6.11. CCRs responses time (ccr_responses_time)
158
-        6.12. Billed seconds (billed_secs)
159
-        6.13. Killed calls (killed_calls)
158
+        6.12. CCRs requests, which ended with a timeout (ccr_timeouts)
159
+        6.13. Billed seconds (billed_secs)
160
+        6.14. Killed calls (killed_calls)
160 161
 
161 162
 1. Overview
162 163
 
... ...
@@ -645,8 +649,9 @@ n");
645 645
    6.9. Failed final CCRs (failed_final_ccrs)
646 646
    6.10. CCRs average response time (ccr_avg_response_time)
647 647
    6.11. CCRs responses time (ccr_responses_time)
648
-   6.12. Billed seconds (billed_secs)
649
-   6.13. Killed calls (killed_calls)
648
+   6.12. CCRs requests, which ended with a timeout (ccr_timeouts)
649
+   6.13. Billed seconds (billed_secs)
650
+   6.14. Killed calls (killed_calls)
650 651
 
651 652
 6.1. Initial CCRs (initial_ccrs)
652 653
 
... ...
@@ -696,10 +701,14 @@ n");
696 696
 
697 697
    Total CCA arrival time in milliseconds.
698 698
 
699
-6.12. Billed seconds (billed_secs)
699
+6.12. CCRs requests, which ended with a timeout (ccr_timeouts)
700
+
701
+   Number of CCR-Requests, which ran into an timeout.
702
+
703
+6.13. Billed seconds (billed_secs)
700 704
 
701 705
    Number of seconds billed in total.
702 706
 
703
-6.13. Killed calls (killed_calls)
707
+6.14. Killed calls (killed_calls)
704 708
 
705 709
    Number of calls that were killed due to lack of credit.
... ...
@@ -634,6 +634,10 @@ route[CHARGING_CCR_REPLY]
634 634
       <para>Total CCA arrival time in milliseconds.</para>
635 635
     </section>
636 636
     <section>
637
+      <title>CCRs requests, which ended with a timeout (ccr_timeouts)</title>
638
+      <para>Number of CCR-Requests, which ran into an timeout.</para>
639
+    </section>
640
+    <section>
637 641
       <title>Billed seconds (billed_secs)</title>
638 642
       <para>Number of seconds billed in total.</para>
639 643
     </section>
... ...
@@ -651,6 +651,12 @@ static void resume_on_interim_ccr(int is_timeout, void *param, AAAMessage *cca,
651 651
 	struct interim_ccr *i_req	= (struct interim_ccr *) param;
652 652
 	Ro_CCA_t * ro_cca_data = NULL;
653 653
 
654
+    if (is_timeout) {
655
+        update_stat(ccr_timeouts, 1);
656
+        LM_ERR("Transaction timeout - did not get CCA\n");
657
+        goto error;
658
+    }
659
+
654 660
     update_stat(ccr_responses_time, elapsed_msecs);
655 661
 
656 662
 	if (!i_req) {
... ...
@@ -833,6 +839,12 @@ error0:
833 833
 static void resume_on_termination_ccr(int is_timeout, void *param, AAAMessage *cca, long elapsed_msecs) {
834 834
     Ro_CCA_t *ro_cca_data = NULL;
835 835
 
836
+    if (is_timeout) {
837
+        update_stat(ccr_timeouts, 1);
838
+        LM_ERR("Transaction timeout - did not get CCA\n");
839
+        goto error;
840
+    }
841
+
836 842
     update_stat(ccr_responses_time, elapsed_msecs);
837 843
 
838 844
     if (!cca) {
... ...
@@ -1021,6 +1033,13 @@ static void resume_on_initial_ccr(int is_timeout, void *param, AAAMessage *cca,
1021 1021
     struct session_setup_data *ssd = (struct session_setup_data *) param;
1022 1022
     int error_code	= RO_RETURN_ERROR;
1023 1023
 
1024
+    if (is_timeout) {
1025
+        update_stat(ccr_timeouts, 1);
1026
+        LM_ERR("Transaction timeout - did not get CCA\n");
1027
+	error_code =  RO_RETURN_ERROR;
1028
+        goto error0;
1029
+    }
1030
+
1024 1031
     update_stat(ccr_responses_time, elapsed_msecs);
1025 1032
 
1026 1033
     if (!cca) {
... ...
@@ -1039,7 +1058,7 @@ static void resume_on_initial_ccr(int is_timeout, void *param, AAAMessage *cca,
1039 1039
 	if (tmb.t_lookup_ident(&t, ssd->tindex, ssd->tlabel) < 0) {
1040 1040
 		LM_ERR("t_continue: transaction not found\n");
1041 1041
 		error_code	= RO_RETURN_ERROR;
1042
-		goto error1;
1042
+		goto error0;
1043 1043
 	}
1044 1044
 
1045 1045
 	// we bring the list of AVPs of the transaction to the current context
... ...
@@ -60,6 +60,7 @@ stat_var *successful_final_ccrs;
60 60
 stat_var *ccr_responses_time;
61 61
 stat_var *billed_secs;
62 62
 stat_var *killed_calls;
63
+stat_var *ccr_timeouts;
63 64
 
64 65
 /** module functions */
65 66
 static int mod_init(void);
... ...
@@ -113,6 +114,7 @@ stat_export_t charging_stats[] = {
113 113
     {"ccr_responses_time", STAT_NO_RESET, &ccr_responses_time},
114 114
     {"billed_secs", STAT_NO_RESET, &billed_secs},
115 115
     {"killed_calls", STAT_NO_RESET, &killed_calls},
116
+    {"ccr_timeouts", STAT_NO_RESET, &ccr_timeouts},
116 117
     {0, 0, 0}
117 118
 };
118 119
 
... ...
@@ -19,6 +19,7 @@ extern stat_var *successful_final_ccrs;
19 19
 extern stat_var *ccr_responses_time;
20 20
 extern stat_var *billed_secs;
21 21
 extern stat_var *killed_calls;
22
+extern stat_var *ccr_timeouts;
22 23
 
23 24
 unsigned long get_failed_initial_ccrs();
24 25
 unsigned long get_failed_interim_ccrs();