CBD-771: Stats archiver uses ETS to replace Mnesia

Stats are stored in memory resident ETS tables and are dumped to
backup files periodically. Cascade and truncate happen in memory
now. Stats backup files are saved in data/<node>/stats directory
which is parallel to data/<node>/mnesia.

Using ETS to replace mnesia certainly saves CPU usage. On idle
2-node cluster with 3~5 buckets, I see the CPU% drops at least
10%.

Based on work of Liang Guo.

Change-Id: If57932e0caae6e28e9b57b6317ba87e0b870b422
Reviewed-on: http://review.couchbase.org/22545
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5307 run_on_subset doesn't crash when there are no stats.

If there are no stats samples we'll default to running on a subset
which seems safe and not too disturbing.

Change-Id: Ie3f5cc58b42b73d05d5d963164a3c2bb5445be9f
Reviewed-on: http://review.couchbase.org/24210
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
MB-5307 Fix typo in ns_node_disco.

Change-Id: I77861d0eb48845f0d6c1f6a90e1b4cb8349865c9
Reviewed-on: http://review.couchbase.org/24253
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>