/* * Fills io section of one backend */ static void fill_backend_io(rapidjson::Value &stat_value, rapidjson::Document::AllocatorType &allocator, const struct dnet_backend_io &backend) { rapidjson::Value io_value(rapidjson::kObjectType); rapidjson::Value blocking_stat(rapidjson::kObjectType); dump_list_stats(blocking_stat, backend.pool.recv_pool.pool->list_stats, allocator); io_value.AddMember("blocking", blocking_stat, allocator); rapidjson::Value nonblocking_stat(rapidjson::kObjectType); dump_list_stats(nonblocking_stat, backend.pool.recv_pool_nb.pool->list_stats, allocator); io_value.AddMember("nonblocking", nonblocking_stat, allocator); stat_value.AddMember("io", io_value, allocator); }
/* * Fills io section of one backend */ static void fill_backend_io(rapidjson::Value &stat_value, rapidjson::Document::AllocatorType &allocator, const struct dnet_backend_io *backend) { rapidjson::Value io_value(rapidjson::kObjectType); rapidjson::Value blocking_stat(rapidjson::kObjectType); auto size = dnet_get_pool_queue_size(backend->pool.recv_pool.pool); blocking_stat.AddMember("current_size", size, allocator); io_value.AddMember("blocking", blocking_stat, allocator); rapidjson::Value nonblocking_stat(rapidjson::kObjectType); size = dnet_get_pool_queue_size(backend->pool.recv_pool_nb.pool); nonblocking_stat.AddMember("current_size", size, allocator); io_value.AddMember("nonblocking", nonblocking_stat, allocator); stat_value.AddMember("io", io_value, allocator); }