X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=microbench%2Fparse-results.py;h=f1da56cc6802706683f3dac73330ffae33b666ca;hb=ddb7469bd1b34c123e24ab8c294459a2b62eaf95;hp=64a17d3eee93784422a4553747b298d04fcc74e1;hpb=32b11c9f706e4c623b65784024d23a56474539f3;p=bluesky.git diff --git a/microbench/parse-results.py b/microbench/parse-results.py index 64a17d3..f1da56c 100755 --- a/microbench/parse-results.py +++ b/microbench/parse-results.py @@ -31,6 +31,11 @@ def load_results(prefix): return (settings, results) def extract(data, params={}, ty='read', index=0): + if ty == 'mixed': + ty = ('read', 'write') + else: + ty = (ty,) + results = {} for (s, r) in data: match = True @@ -40,10 +45,13 @@ def extract(data, params={}, ty='read', index=0): ops = int(s['BENCH_OPS']) - vals = [x[ty][index] for x in r] - vals = vals[5:] + vs = 0.0 + for t in ty: + vals = [x[t][index] for x in r] + vals = vals[5:] + vs += sum(vals) / len(vals) + results[ops] = vs - results[ops] = sum(vals) / len(vals) return results data = [] @@ -52,14 +60,20 @@ if __name__ == '__main__': if f.endswith('.settings'): data.append(load_results('results/' + f[:-len('.settings')])) +ratios = {'read': '0.0', 'write': '1.0', 'mixed': '0.5'} + for size in [128, 512, 1024, 2048]: - params = {'BLUESKY_TARGET': 'native', 'BENCH_WRITERATIO': '1.0', - 'BENCH_FILECOUNT': str(size / 4)} + for blocksize in [4096, 32768]: + for ratio in ratios: + params = {'BLUESKY_TARGET': 's3', + 'BENCH_WRITERATIO': ratios[ratio], + 'BENCH_FILECOUNT': str(size), + 'BENCH_BLOCKSIZE': str(blocksize)} - d0 = extract(data, params, ty='write', index=0) - d1 = extract(data, params, ty='write', index=1) + d0 = extract(data, params, ty=ratio, index=0) + d1 = extract(data, params, ty=ratio, index=1) - fp = open('%s-%d-write.data' % (params['BLUESKY_TARGET'], size), 'w') - for k in sorted(d0.keys()): - fp.write("%d\t%f\t%f\n" % (k, d0[k], d1[k])) - fp.close() + fp = open('%s-%d-%s-%dk.data' % (params['BLUESKY_TARGET'], size, ratio, blocksize / 1024), 'w') + for k in sorted(d0.keys()): + fp.write("%d\t%f\t%f\n" % (k, d0[k], d1[k])) + fp.close()