]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
omapbench: fix misc warnings
authorSage Weil <sage@inktank.com>
Sat, 2 Jun 2012 20:18:01 +0000 (13:18 -0700)
committerSage Weil <sage@inktank.com>
Sat, 2 Jun 2012 20:18:01 +0000 (13:18 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/test/omap_bench.cc
src/test/omap_bench.hpp

index 0bc7d860927032d91396b840de7f8b067e1f8a18..97b13087a7a4dc1506f34d34b862da1473a3de92 100644 (file)
 #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;
   }
index 2a40557d5dee866f7d72a2eb20b625db32ed97e2..4c6061ead78bef49fe34f3c52d94b366360ac9f3 100644 (file)
 #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