query profiler and data collector.

this isn't completely functional yet, but there's no harmful side effects so far.