pmdaprometheus: performance tweaks
pmdaprometheus: performance tweaks

1) defer metric-indom saves until end of document processing

Previous code frequently flushed to disk and the c layer too
frequently, after each incremental new instance found.  Now we batch
it until a complete export document has been processed.

2) throttle polling of as-yet-empty sources

Previous code frequently polled sources whose URLs we have, but from
whom we haven't made a successful connection to gather metrics.  (Each
python/pmda.c maybe_refresh would trigger this, perhaps many times a
second.)  Now we throttle this to a minimum interval (hardcoded at
10s).  This limits the responsiveness of pmdaprometheus to new sources
coming online, but reduces load (and fetch timeout latency) the rest
of the time.

adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp