[dump-stats] Read stats archives and write json incrementally.
[dump-stats] Read stats archives and write json incrementally.

I tested this code on the enormous stats archives from CBSE-3161. It
ran in a more or less constant memory and actually worked faster than
non-incremental variant.

I got about 11MiB worth of json output per second. Which is not great,
but also not extremely terrible. There was also no significant
difference between the times needed to produce pretty and compact
json. So I settled on a pretty version, which makes it much easier to
deal with the stats_archives.json file in GNU/Emacs.

Change-Id: Iae7bc85fa8a18e79d7f8c06678d18e890f5f7ec9
Reviewed-on: http://review.couchbase.org/71704
Tested-by: Aliaksey Artamonau <3c875bcfb3adf2a65b2ae7686ca921e6c9433147@gmail.com>
Reviewed-by: Artem Stemkovski <15a0730a27c69f62ab86f2b6c639fca202166c02@couchbase.com>

ceejatec/ns_server,ceejatec/ns_server,membase/ns_server,ceejatec/ns_server,membase/ns_server,membase/ns_server,membase/ns_server,ceejatec/ns_server,membase/ns_server,ceejatec/ns_server,membase/ns_server,ceejatec/ns_server