bdev: add extra parameters to iostat rpc.

These parameters include read and write latency ticks, current queue
depth, and the period at which the queue depth is beign polled.

Change-Id: I7c57177e3cd1629b957a16dd8f4fa992ef53ae3d
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/418117
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Seth Howell 2018-07-05 14:23:55 -07:00 committed by Jim Harris
parent 0398702483
commit cf82b9bcc2

View File

@ -31,6 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "spdk/env.h"
#include "spdk/log.h" #include "spdk/log.h"
#include "spdk/rpc.h" #include "spdk/rpc.h"
#include "spdk/string.h" #include "spdk/string.h"
@ -75,6 +76,20 @@ spdk_rpc_get_bdevs_iostat_cb(struct spdk_bdev *bdev,
spdk_json_write_name(w, "num_write_ops"); spdk_json_write_name(w, "num_write_ops");
spdk_json_write_uint64(w, stat->num_write_ops); spdk_json_write_uint64(w, stat->num_write_ops);
spdk_json_write_name(w, "read_latency_ticks");
spdk_json_write_uint64(w, stat->read_latency_ticks);
spdk_json_write_name(w, "write_latency_ticks");
spdk_json_write_uint64(w, stat->write_latency_ticks);
if (spdk_bdev_get_qd_sampling_period(bdev)) {
spdk_json_write_name(w, "queue_depth_polling_period");
spdk_json_write_uint64(w, spdk_bdev_get_qd_sampling_period(bdev));
spdk_json_write_name(w, "queue_depth");
spdk_json_write_uint64(w, spdk_bdev_get_qd(bdev));
}
spdk_json_write_object_end(w); spdk_json_write_object_end(w);
} }
@ -153,6 +168,11 @@ spdk_rpc_get_bdevs_iostat(struct spdk_jsonrpc_request *request,
spdk_json_write_array_begin(w); spdk_json_write_array_begin(w);
spdk_json_write_object_begin(w);
spdk_json_write_name(w, "tick_rate");
spdk_json_write_uint64(w, spdk_get_ticks_hz());
spdk_json_write_object_end(w);
if (bdev != NULL) { if (bdev != NULL) {
stat = calloc(1, sizeof(struct spdk_bdev_io_stat)); stat = calloc(1, sizeof(struct spdk_bdev_io_stat));
if (stat == NULL) { if (stat == NULL) {