diff options
Diffstat (limited to 'src/third_party/wiredtiger/dist/db.py')
-rw-r--r-- | src/third_party/wiredtiger/dist/db.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/dist/db.py b/src/third_party/wiredtiger/dist/db.py new file mode 100644 index 00000000000..06a9484d1f9 --- /dev/null +++ b/src/third_party/wiredtiger/dist/db.py @@ -0,0 +1,24 @@ +# A simple python script to build a file that can be bulk-loaded into a +# WiredTiger database for smoke-testing. + +import getopt, random, sys + +dmin = 7 # Minimum data size +dmax = 837 # Maximum data size + +seed = None # Random number seed +pairs = 100000 # Key/data pairs to output + +opts, args = getopt.getopt(sys.argv[1:], "m:n:s:") +for o, a in opts: + if o == "-m": + dmax = int(a) + elif o == "-n": + pairs = int(a) + elif o == "-s": + seed = int(a) + +random.seed(seed) +for i in range(pairs): + fmt = "%010d\ndata: %0" + str(random.randrange(dmin, dmax)) + "d" + print(fmt % (i, i)) |