only index when there are modules registered.
Do not track index-write metrics in DiscoveryWriter.
Track index batch sizes and how long they take.

Track sizes, even when they are zero.
But only write track duration when there is stuff to index.
Merge pull request #359 from gdusbabek/ES_metrics

Measure ElasticSearch write peformance