I'm currently using version 4.4.2 and am having trouble trying to reset the statistics in the TMX module. According to its documentation, all statistics except “inuse_transactions” can be reset.
Checking the tmx_mod.c files for the statistics definition, I saw that the STAT_NO_RESET flag wasn't used for any statistic listed there (which seems odd because I think it should have been set for the inuse_transactions statistic):
`static stat_export_t mod_stats[] = { {"UAS_transactions", STAT_IS_FUNC, (stat_var**)tmx_stats_uas_trans }, {"UAC_transactions", STAT_IS_FUNC, (stat_var**)tmx_stats_uac_trans }, {"2xx_transactions", STAT_IS_FUNC, (stat_var**)tmx_stats_trans_2xx }, {"3xx_transactions", STAT_IS_FUNC, (stat_var**)tmx_stats_trans_3xx }, {"4xx_transactions", STAT_IS_FUNC, (stat_var**)tmx_stats_trans_4xx }, {"5xx_transactions", STAT_IS_FUNC, (stat_var**)tmx_stats_trans_5xx }, {"6xx_transactions", STAT_IS_FUNC, (stat_var**)tmx_stats_trans_6xx }, {"inuse_transactions", STAT_IS_FUNC, (stat_var**)tmx_stats_trans_inuse }, {"active_transactions", STAT_IS_FUNC, (stat_var**)tmx_stats_trans_active}, {"rpl_received", STAT_IS_FUNC, (stat_var**)tmx_stats_rcv_rpls }, {"rpl_absorbed", STAT_IS_FUNC, (stat_var**)tmx_stats_abs_rpls }, {"rpl_generated", STAT_IS_FUNC, (stat_var**)tmx_stats_rld_loc_rpls}, {"rpl_relayed", STAT_IS_FUNC, (stat_var**)tmx_stats_rld_rcv_rpls}, {"rpl_sent", STAT_IS_FUNC, (stat_var**)tmx_stats_rld_tot_rpls}, {0, 0, 0} };`
All seems ok, but when I try to reset the stats, the command simply doesn't work. The values remain unaltered. The clear command doesn't work either, it just returns the current values.
What command did you use to do the reset the stats?
I tried: stats.clear_statistics all stats.reset_statistics all stats.clear_statistics tmx <field> stats.reset_statistics tmx <field>
But none of those commands worked.
I was able to do a short test myself and I can confirm the behaviour. I will have to check in the sources.
Closed #820.
Finally got some time to look at this issue. The tmx stats are returned with function callbacks, so there is no value that can be reset. The values are computed each time on demand by executing the callback functions. The docs were wrong.
You can try to use the counters module, which provides some commands to control the counters (some of them are behind the stats).
I am closing this item, the docs of tmx were updated on master branch (to be eventually backported).