Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / test / erasure-code / ceph_erasure_code_benchmark.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph distributed storage system
5  *
6  * Copyright (C) 2013,2014 Cloudwatt <libre.licensing@cloudwatt.com>
7  * Copyright (C) 2014 Red Hat <contact@redhat.com>
8  *
9  * Author: Loic Dachary <loic@dachary.org>
10  *
11  *  This library is free software; you can redistribute it and/or
12  *  modify it under the terms of the GNU Lesser General Public
13  *  License as published by the Free Software Foundation; either
14  *  version 2.1 of the License, or (at your option) any later version.
15  *
16  */
17
18 #ifndef CEPH_ERASURE_CODE_BENCHMARK_H
19 #define CEPH_ERASURE_CODE_BENCHMARK_H
20
21 #include <string>
22
23 using namespace std;
24
25 class ErasureCodeBench {
26   int in_size;
27   int max_iterations;
28   int erasures;
29   int k;
30   int m;
31
32   string plugin;
33
34   bool exhaustive_erasures;
35   vector<int> erased;
36   string workload;
37
38   ErasureCodeProfile profile;
39
40   bool verbose;
41   boost::intrusive_ptr<CephContext> cct;
42 public:
43   int setup(int argc, char** argv);
44   int run();
45   int decode_erasures(const map<int,bufferlist> &all_chunks,
46                       const map<int,bufferlist> &chunks,
47                       unsigned i,
48                       unsigned want_erasures,
49                       ErasureCodeInterfaceRef erasure_code);
50   int decode();
51   int encode();
52 };
53
54 #endif