blob: 3692389ff4055f827f094b3912a50da08b81c807 [file] [log] [blame]
koder aka kdanilov3cbbc9d2015-02-04 15:37:58 +02001import sys
2import uuid
3import random
4import itertools
5
6from petname import Generate as pet_generate
7from storage_api import create_storage
8
9
10types = ["GA", "master"] + [pet_generate(2, '-') for _ in range(10)]
11random.shuffle(types)
12tp = itertools.cycle(types)
13
14sz = ["4k", "64k", "1m"]
15op_type = ["randread", "read", "randwrite", "write"]
16is_sync = ["s", "a"]
17
18storage = create_storage(sys.argv[1])
19
20for i in range(30):
21 row = {"build_id": pet_generate(2, " "),
22 "type": next(tp),
23 "iso_md5": uuid.uuid4().get_hex()}
24
25 for sz, op_type, is_sync in itertools.product(op_type, is_sync, sz):
26 row[" ".join([sz, op_type, is_sync])] = (random.random(),
27 random.random() / 5)
28
29 storage.store(row)