ep_perfsuite: 10x load gen speedup - only generate needed random data
ep_perfsuite: 10x load gen speedup - only generate needed random data

The genVectorOfValues() function (used to generate random input data
for the DCP perf/latency tests) builds random JSON documents by
constructing a large (10x the loop counter) random string, then taking
substrings of the random string to build the JSON documents' fields.

However, the JSON field substrings are very small compared to the
random string - the largest is only 5% of the length of the random
string. This means that a large amount of random data is generated
which is never used - 120 million random characters are generated, but
only 9.4M of those characters are ever used in the JSON.

Furthermore, the JSON documents created arn't very 'random' - we
actually re-use large sections of the random string for different
fields.

Address the unnecessary random generation issue by creating a
make_random_string() function which generates a string of random
alphanumeric characters of the requested length, and build the
document from that.

This only generates as much random data as needed (but the document
fields are now 'properly' random) reducing the test load generation
phase from 9.7s to 0.4s, and the overall dcp / latency test runtime to
~1s (down from 10s).

Change-Id: I0fe6c7ce42012ecd15081eb6307c571e05790f50
Reviewed-on: http://review.couchbase.org/59600
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Jim Walker <1cd02e31b43620d7c664e038ca42a060d61727b9@couchbase.com>

daverigby/kv_engine,couchbase/ep-engine,teligent-ru/ep-engine,owendCB/ep-engine,daverigby/ep-engine,owendCB/ep-engine,hisundar/ep-engine,hisundar/ep-engine,daverigby/ep-engine,owendCB/ep-engine,teligent-ru/ep-engine,teligent-ru/ep-engine,hisundar/ep-engine,daverigby/kv_engine,teligent-ru/ep-engine,couchbase/ep-engine,daverigby/ep-engine,membase/ep-engine,membase/ep-engine,hisundar/ep-engine,couchbase/ep-engine,owendCB/ep-engine,membase/ep-engine,couchbase/ep-engine,daverigby/kv_engine,daverigby/kv_engine,membase/ep-engine,daverigby/ep-engine