Skip to content

Commit

Permalink
osd: Additional fields for osd "bench" command
Browse files Browse the repository at this point in the history
This patch adds new fields for output of "bench" OSD command:

* elapsed_sec (elapsed time of benchmarking process)
* iops (writes per second)

And also, it improves precision for bytes_per_sec field.

Signed-off-by: Коренберг Маркr <socketpair@gmail.com>
(cherry picked from commit ffe4b04)
  • Loading branch information
socketpair authored and smithfarm committed Sep 11, 2018
1 parent 4a7291d commit 99f483a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/osd/OSD.cc
Expand Up @@ -6094,18 +6094,23 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector<string>& cmd, buffe
}
}

uint64_t rate = (double)count / (end - start);
double elapsed = end - start;
double rate = count / elapsed;
double iops = rate / bsize;
if (f) {
f->open_object_section("osd_bench_results");
f->dump_int("bytes_written", count);
f->dump_int("blocksize", bsize);
f->dump_unsigned("bytes_per_sec", rate);
f->dump_float("elapsed_sec", elapsed);
f->dump_float("bytes_per_sec", rate);
f->dump_float("iops", iops);
f->close_section();
f->flush(ds);
} else {
ds << "bench: wrote " << byte_u_t(count)
<< " in blocks of " << byte_u_t(bsize) << " in "
<< (end-start) << " sec at " << byte_u_t(rate) << "/sec";
<< elapsed << " sec at " << byte_u_t(rate) << "/sec "
<< si_u_t(iops) << " IOPS";
}
}

Expand Down

0 comments on commit 99f483a

Please sign in to comment.