Add some instrumentation to measure performance.