Tim Starling writes:
You should have a look at how tracking categories work in the core, see Parser::addTrackingCategory().
Ooo, shiny! Thanks for the great tip.
Is there any way to use addTrackingCategory (or similar) if the category name must be computed at runtime, not a piece of static text in a system message file? Our parser tag doesn't actually categorize articles in "Category:Pages that hit SQL Server databases" -- this was a simplification. It actually categorizes as "Category:Pages that hit SQL Server database %s", where %s is the name of the database (passed as a parameter to the parser tag).
This is why $wgMessageCache->addMessage() worked so well.
A variant $parser->addTrackingCategory($msg, $args...) would work great if it existed.
Thanks so much for your help, DanB