FS#7809 - Gather statistics about menu usage (and, possibly, reorder menu items)
Opened by Alexander Levin (fml2) - Friday, 21 September 2007, 22:13 GMT
Last edited by Alex Parker (BigBambi) - Sunday, 06 June 2010, 08:23 GMT
Here is my shot at what has been discussed on IRC a couple of days ago. Since I already provided a patch for reordering of items in the main menu (but it was rejected), I liked the idea because:
1. It's more general (applies to all menus, not only the main one)
2. Menus are adjusted automatically to each user's usage pattern
3. Even if not used for automatic reordering, it can be used for gathering statistics about the GUI usage and thus provide information for optimizing the menu structure
This is just the first quick try, but I hope the idea is clear: each menu item gets a unique ID. IDs are generated by macros, so no need to edit many source files; hopefully, there won't be any name conflicts. If there will the line number (as in PP macro __LINE__) could somehow be incorporated into the ID. I just couldn't figure how to do it. With lines incorporated, names become more unique but also more fragile.
Also, each item gets a counter for how many times the item was selected.
Then, before a menu is displayed, its items are reordered so that more frequently used items go to the top.
At shut down, the stats can be dumped to a file, and loaded again at startup.
There could/should also be settings telling:
- whether the stats should be gathered (maybe you've achieved your dream configuration want to freeze it?)
- whether the reordering should be made (useful e.g. for blind users)
1. Find a better place for the definition of GATHER_CALL_STATS so that this feature can be cut at compile time
2. Add something to the macros that would register each item's stats struct in a global array. This array would then be used for dumping/loading
3. Implement dumping/loading the stats (now everything is initialized with zero)
4. Add the appropriate settings
Please don't put this down immediately after you see "menu reordering." Just live with the idea some time, and maybe you'll like it. And I'd be glad if someone would help me with all this.
I'd definitely use it to reorder some items and would then freeze my stats once the desired and frequently used items are on the places where I'd like to find them.
Sunday, 06 June 2010, 08:23 GMT
Reason for closing: Rejected