From 037dfdcf358178246d63fa7f673c7e67293f02ce Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Wed, 9 Sep 2015 04:08:03 +0300 Subject: [PATCH] API: add get_load implementation to storage_service Because of the different implementation the right way of getting the load (which is the sum of all the live diskspace used) is using the column_family api and not through the storage_service API. Signed-off-by: Amnon Heiman --- api/storage_service.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/storage_service.cc b/api/storage_service.cc index 36342ad279..444440367d 100644 --- a/api/storage_service.cc +++ b/api/storage_service.cc @@ -12,6 +12,7 @@ #include "http/exception.hh" #include "repair/repair.hh" #include "locator/snitch_base.hh" +#include "column_family.hh" namespace api { @@ -121,8 +122,8 @@ void set_storage_service(http_context& ctx, routes& r) { get_token_metadata().get_endpoint_to_host_id_map_for_reading(), res); }); - ss::get_load.set(r, [](const_req req) { - return service::get_local_storage_service().get_load(); + ss::get_load.set(r, [&ctx](std::unique_ptr req) { + return get_cf_stats(ctx, &column_family::stats::live_disk_space_used); }); ss::get_load_map.set(r, [](const_req req) {