def seq1(keys, values, repeat): kv_pairs = [] key = keys[0] value = values[0] for flags in asciiVals: kv_pairs.append(memlib.kv_pair(key, value, "%08x" % flags, 42)) for key in keys: for value in values: flags = asciiVals[0] kv_pairs.append(memlib.kv_pair(key, value, "%08x" % flags, 42)) testset = memlib.newTestset() for kv_pair in kv_pairs: memlib.setSuccess(kv_pair, testset) for _ in range(repeat): memlib.getSuccess(kv_pair, testset) return testset
def seq2(keys, values): testset = memlib.newTestset() for _ in range(len(values)): # for more keys than values, duplicate use of values values_used = values if len(keys) > len(values): while (len(keys) > len(values_used)): values_used = values_used + values values_used = values_used[0:len(keys)] # requests kv_pairs = map(pair2kvpair, zip(keys, values_used, asciiVals * 50)) for kv_pair in kv_pairs: memlib.setSuccess(kv_pair, testset) for kv_pair in kv_pairs: memlib.getSuccess(kv_pair, testset) # rotation values = values[1:] + values[0:1] return testset
#!/usr/bin/python import memlib testset = memlib.newTestset() for i in range(300): pair = memlib.kv_pair("K%03d" % i, "V%03d" % i, "ABCDEF01", 0) memlib.set(pair, testset) memlib.generate("MANYKEYS", testset) memlib.generate_hls("MANYKEYS", testset)