Created a patch for 4.1 which allows to display also the total number of pkg fragments upon calling kamcmd pkg.stats. This combines part of the master logic with existing 4.1 logic (for example this version does not combine the SREV_PKG_SET_USED, SREV_PKG_SET_REAL_USED, SREV_PKG_SET_FRAGS into one callback.)
Does this look ok? Feel free to close this if not needed. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/575
-- Commit Summary --
* kex: adding total_frags to kamcmd pkg.stats
-- File Changes --
M events.c (13) M events.h (2) M mem/f_malloc.c (9) M mem/f_malloc.h (1) M mem/q_malloc.c (20) M mem/q_malloc.h (1) M modules/kex/pkg_stats.c (17)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/575.patch https://github.com/kamailio/kamailio/pull/575.diff
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/575
Is this actually replacing the old way in 4.1 of returning total_frags (which was iterating through hash table slots) with the new way in more recent 4.x that keeps a dedicated field for this statistic and is faster?
4.1 is no longer in the focus for maintenance, no releases out of that branch. If people are still using 4.1 from git and this is a fix to the slow approach of getting the total_frags, I don't have anything against merging if nobody else finds issues with it.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/575#issuecomment-212348180
Hi Daniel,
You are right, this is meant to replace the iteration related to total_frags with the new field.
On a deeper analysis however, I see I have not fully taken in consideration (at least) the shm vs private memory distinction in relation to triggering the execution of sr_event SREV_PKG_SET_FRAGS in q/f_malloc.c (in master you introduced the qm->type==MEM_TYPE_PKG which allows you to change the position of sr_event_exec for SREV_PKG_UPDATE_STATS vs previous SREV_PKG_SET_USED ) This enhancement seems more complex than anticipated. I will close the pull request.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/575#issuecomment-212423399
Closed #575.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/575#event-635854427