Instrument indexing: queue length, batch sizes and latencies.

Change-Id: I60bcbd24b160e47d418a485d8cffa39344a257c6
Minor cleanups.

Change-Id: Ia8685d8439a421fe2143d9ec7120d5bb5ab88d78