In our code base we have added a WithStats-Flavor for creating memory contexts.
This api accepts a pointer to metric for accounting and it is inherited by all subcontexts unless overridden.
So we only needed to change context creation API where we wanted (such as TopTansactionContext, Message Context, ..)
That's quite trivial, actually.
Also we have fixed all those missing hash spills - albeit based on the 9.6 hash table design I think.
If there is interest by the community we are very willing to share.
Cheers
Serge
Salesforce