[eluser]jedd[/eluser]
It's almost like you're intending to keep the number of database calls visible on every page, even in production.
Uhm, you could delve into the profiling class and see how it does it. I have no idea how you'd go about trying to rip components of that out, though, other than cut-n-paste, perhaps trying to override the class.
Can I ask what the motivation is here to have a subset of the profiling information shown?