diff options
author | Sage Weil <sage@inktank.com> | 2012-06-02 13:18:01 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-06-02 13:18:01 -0700 |
commit | ab5139b30071016f22b7ae5151538e929361f6f9 (patch) | |
tree | 5e3a91235fbc66159f54f2c66332f1cadde41555 /src/test | |
parent | 6f3e7a84a2238c0d77989332e6e6768090a06bd7 (diff) | |
download | ceph-ab5139b30071016f22b7ae5151538e929361f6f9.tar.gz |
omapbench: fix misc warnings
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/omap_bench.cc | 13 | ||||
-rw-r--r-- | src/test/omap_bench.hpp | 35 |
2 files changed, 28 insertions, 20 deletions
diff --git a/src/test/omap_bench.cc b/src/test/omap_bench.cc index 0bc7d860927..97b13087a7a 100644 --- a/src/test/omap_bench.cc +++ b/src/test/omap_bench.cc @@ -21,10 +21,10 @@ #include "common/ceph_argparse.h" #include "omap_bench.hpp" -#include<string> -#include<iostream> -#include<cassert> -#include<climits> +#include <string> +#include <iostream> +#include <cassert> +#include <climits> using namespace std; using ceph::bufferlist; @@ -56,7 +56,7 @@ int OmapBench::setup(int argc, const char** argv) { //parse omap_bench args vector<const char*> args; argv_to_vec(argc,argv,args); - for (int i = 0;i < args.size(); i++) { + for (unsigned i = 0; i < args.size(); i++) { if (strcmp(args[i], "-t") == 0){ threads = atoi(args[i+1]); } else if (strcmp(args[i],"-o") == 0){ @@ -167,8 +167,7 @@ void OmapBench::aio_is_safe(rados_completion_t c, void *arg) { double time = aiow->get_time(); delete aiow; data_lock->Lock(); - data.avg_latency = (data.avg_latency * - data.completed_ops + time) / ++(data.completed_ops); + data.avg_latency = (data.avg_latency * data.completed_ops + time) / ++(data.completed_ops); if (time < data.min_latency){ data.min_latency = time; } diff --git a/src/test/omap_bench.hpp b/src/test/omap_bench.hpp index 2a40557d5de..4c6061ead78 100644 --- a/src/test/omap_bench.hpp +++ b/src/test/omap_bench.hpp @@ -18,12 +18,12 @@ #include "common/Cond.h" #include "include/rados/librados.hpp" #include <string> -#include<map> -#include<cfloat>; +#include <map> +#include <cfloat> using ceph::bufferlist; -struct omap_bench_data{ +struct omap_bench_data { double avg_latency; double min_latency; double max_latency; @@ -32,15 +32,18 @@ struct omap_bench_data{ int completed_ops; std::map<int,int> freq_map; pair<int,int> mode; - omap_bench_data(): avg_latency(0.0), min_latency(DBL_MAX), max_latency(0.0), - total_latency(0.0),started_ops(0),completed_ops(0),freq_map(),mode(){} - + omap_bench_data() + : avg_latency(0.0), min_latency(DBL_MAX), max_latency(0.0), + total_latency(0.0), + started_ops(0), completed_ops(0) + {} }; class OmapBench; typedef int (*omap_generator_t)(const int omap_entries, const int key_size, - const int value_size, std::map<std::string,bufferlist> * out_omap); + const int value_size, + std::map<std::string,bufferlist> *out_omap); typedef int (OmapBench::*test_t)(omap_generator_t omap_gen); @@ -104,12 +107,18 @@ protected: friend class AioWriter; public: - OmapBench() : data(),busythreads_count(0),pool_name("data"),rados_id("admin"), - safe(aio_is_safe),omap_generator(generate_uniform_omap), - thread_is_free_lock("thread is free lock"), data_lock("data lock"), - threads(3),objects(100),omap_entries(10),omap_key_size(10), - omap_value_size(100),increment(10),test(&OmapBench::write_objects_in_parallel) - {}; + OmapBench() + : test(&OmapBench::write_objects_in_parallel), + omap_generator(generate_uniform_omap), + thread_is_free_lock("OmapBench::thread_is_free_lock"), + data_lock("OmapBench::data_lock"), + busythreads_count(0), + safe(aio_is_safe), + pool_name("data"), + rados_id("admin"), + threads(3), objects(100), omap_entries(10), omap_key_size(10), + omap_value_size(100), increment(10) + {} /** * Parses command line args, initializes rados and ioctx |