]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
obj_bencher: cosmetic display fixes 8960/head
authorDmitry Yatsushkevich <dyatsushkevich@mirantis.com>
Mon, 23 Mar 2015 18:05:44 +0000 (11:05 -0700)
committerBrad Hubbard <bhubbard@redhat.com>
Tue, 17 May 2016 07:07:01 +0000 (17:07 +1000)
fix indents in output
change `snprintf' to `setprecision'

Signed-off-by: Dmitry Yatsushkevich <dyatsushkevich@mirantis.com>
(cherry picked from commit ddb422f40394ec2f4fc4a6a6cff49e43538121a9)
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/common/obj_bencher.cc

index ec2fd9a51421b5acc5b52504bbe8577447df86b3..0c246f33a90a52aef40f317b7ec64ea8f4e3666f 100644 (file)
@@ -61,7 +61,7 @@ ostream& ObjBencher::out(ostream& os, utime_t& t)
   if (show_time)
     return t.localtime(os) << " ";
   else
-    return os << " ";
+    return os;
 }
 
 ostream& ObjBencher::out(ostream& os)
@@ -455,21 +455,19 @@ int ObjBencher::write_bench(int secondsToRun, int maxObjectsToCreate,
   double bandwidth;
   bandwidth = ((double)data.finished)*((double)data.object_size)/(double)timePassed;
   bandwidth = bandwidth/(1024*1024); // we want it in MB/sec
-  char bw[20];
-  snprintf(bw, sizeof(bw), "%.3lf \n", bandwidth);
 
   out(cout) << "Total time run:         " << timePassed << std::endl
-    << "Total writes made:      " << data.finished << std::endl
-    << "Write size:             " << data.object_size << std::endl
-    << "Bandwidth (MB/sec):     " << bw << std::endl
-    << "Stddev Bandwidth:       " << vec_stddev(data.history.bandwidth) << std::endl
-    << "Max bandwidth (MB/sec): " << data.idata.max_bandwidth << std::endl
-    << "Min bandwidth (MB/sec): " << data.idata.min_bandwidth << std::endl
-    << "Average IOPS:           " << (int)(data.finished/timePassed) << std::endl
-    << "Average Latency(s):     " << data.avg_latency << std::endl
-    << "Stddev Latency(s):      " << vec_stddev(data.history.latency) << std::endl
-    << "Max latency(s):         " << data.max_latency << std::endl
-    << "Min latency(s):         " << data.min_latency << std::endl;
+       << "Total writes made:      " << data.finished << std::endl
+       << "Write size:             " << data.object_size << std::endl
+       << "Bandwidth (MB/sec):     " << setprecision(6) << bandwidth << std::endl
+       << "Stddev Bandwidth:       " << vec_stddev(data.history.bandwidth) << std::endl
+       << "Max bandwidth (MB/sec): " << data.idata.max_bandwidth << std::endl
+       << "Min bandwidth (MB/sec): " << data.idata.min_bandwidth << std::endl
+       << "Average IOPS:           " << (int)(data.finished/timePassed) << std::endl
+       << "Average Latency(s):     " << data.avg_latency << std::endl
+       << "Stddev Latency(s):      " << vec_stddev(data.history.latency) << std::endl
+       << "Max latency(s):         " << data.max_latency << std::endl
+       << "Min latency(s):         " << data.min_latency << std::endl;
 
   //write object size/number data for read benchmarks
   ::encode(data.object_size, b_write);
@@ -673,14 +671,12 @@ int ObjBencher::seq_read_bench(int seconds_to_run, int num_objects, int concurre
   double bandwidth;
   bandwidth = ((double)data.finished)*((double)data.object_size)/(double)runtime;
   bandwidth = bandwidth/(1024*1024); // we want it in MB/sec
-  char bw[20];
-  snprintf(bw, sizeof(bw), "%.3lf \n", bandwidth);
 
-  out(cout) << "Total time run:        " << runtime << std::endl
+  out(cout) << "Total time run:       " << runtime << std::endl
        << "Total reads made:     " << data.finished << std::endl
-       << "Read size:          " << data.object_size << std::endl
-       << "Bandwidth (MB/sec):   " << setprecision(3) << bandwidth << std::endl
-       << "Average IOPS          " << (int)(data.finished/runtime) << std::endl
+       << "Read size:            " << data.object_size << std::endl
+       << "Bandwidth (MB/sec):   " << setprecision(6) << bandwidth << std::endl
+       << "Average IOPS:         " << (int)(data.finished/runtime) << std::endl
        << "Average Latency(s):   " << data.avg_latency << std::endl
        << "Max latency(s):       " << data.max_latency << std::endl
        << "Min latency(s):       " << data.min_latency << std::endl;
@@ -882,13 +878,11 @@ int ObjBencher::rand_read_bench(int seconds_to_run, int num_objects, int concurr
   double bandwidth;
   bandwidth = ((double)data.finished)*((double)data.object_size)/(double)runtime;
   bandwidth = bandwidth/(1024*1024); // we want it in MB/sec
-  char bw[20];
-  snprintf(bw, sizeof(bw), "%.3lf \n", bandwidth);
 
-  out(cout) << "Total time run:        " << runtime << std::endl
+  out(cout) << "Total time run:       " << runtime << std::endl
        << "Total reads made:     " << data.finished << std::endl
-       << "Read size:          " << data.object_size << std::endl
-       << "Bandwidth (MB/sec):   " << setprecision(3) << bandwidth << std::endl
+       << "Read size:            " << data.object_size << std::endl
+       << "Bandwidth (MB/sec):   " << setprecision(6) << bandwidth << std::endl
        << "Average IOPS:         " << (int)(data.finished/runtime) << std::endl
        << "Average Latency(s):   " << data.avg_latency << std::endl
        << "Max latency(s):       " << data.max_latency << std::endl