diff --git a/modules/tm/t_funcs.c b/modules/tm/t_funcs.c index e6788ef..4c847a3 100644 --- a/modules/tm/t_funcs.c +++ b/modules/tm/t_funcs.c @@ -53,6 +53,7 @@ #include "t_msgbuilder.h" #include "t_lookup.h" #include "config.h" +#include "t_stats.h" #include "../../context.h" @@ -145,6 +146,8 @@ void put_on_wait( struct cell *Trans ) transaction deleted */ set_1timer( &Trans->wait_tl, WT_TIMER_LIST, 0 ); + + stats_trans_code(Trans->uas.status); } diff --git a/modules/tm/t_stats.h b/modules/tm/t_stats.h index 37b9e2b..dfc3c12 100644 --- a/modules/tm/t_stats.h +++ b/modules/tm/t_stats.h @@ -48,10 +48,12 @@ extern stat_var *tm_trans_inuse; #ifdef STATISTICS -inline static void stats_trans_rpl( int code, int local ) { - - stat_var *numerical_stat; - +/* update the statistics regading the final codes of the transactions + * A single transaction will generate a single update on one of + * these statistics + */ +inline static void stats_trans_code( int code) +{ if (tm_enable_stats) { if (code>=700) { return; @@ -66,6 +68,19 @@ inline static void stats_trans_rpl( int code, int local ) { } else if (code>=200) { update_stat( tm_trans_2xx, 1); } + } +} + +/* update the statistics regading the final replies sent to UAC side + * A single transaction may generate multiple updates on different + * statistics if (1) there is a retransmission of the final reply or + * (2) there are multiple final replies (like multi 200 OK) + */ +inline static void stats_trans_rpl( int code, int local ) +{ + stat_var *numerical_stat; + + if (tm_enable_stats) { if (local) update_stat( tm_loc_rpls, 1); else @@ -91,6 +106,7 @@ inline static void stats_trans_new( int local ) { } } #else + #define stats_trans_code( _code ) #define stats_trans_rpl( _code , _local ) #define stats_trans_new( _local ) #endif