Skip to content

Commit

Permalink
tools/rados/rados.cc: restore ostream precision format
Browse files Browse the repository at this point in the history
CID 717135 (yehudasa#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE)
1. format_changed: precision changes the format state of std::cout for
   category precision.
4. end_of_path: Changing format state of stream std::cout for category
   precision without later restoring it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
  • Loading branch information
dalgaaf committed Jun 1, 2015
1 parent 6ffec51 commit bbeb37f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tools/rados/rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,10 @@ class LoadGen {
Mutex::Locker l(lock);

double rate = (double)cur_completed_rate() / (1024 * 1024);
std::streamsize original_precision = cout.precision();
cout.precision(3);
cout << "op " << op->id << " completed, throughput=" << rate << "MB/sec" << std::endl;
cout.precision(original_precision);

map<int, LoadGenOp *>::iterator iter = pending_ops.find(op->id);
if (iter != pending_ops.end())
Expand Down

0 comments on commit bbeb37f

Please sign in to comment.