Add rdbms.ProfilingObserver to measure overall SQL performance

This adds the named class; some refactorings were necessary, w/o BC break.