|
|
|
|
@@ -10,7 +10,6 @@
|
|
|
|
|
#include "service/storage_proxy.hh"
|
|
|
|
|
#include "api/api-doc/storage_proxy.json.hh"
|
|
|
|
|
#include "api/api-doc/utils.json.hh"
|
|
|
|
|
#include "service/storage_service.hh"
|
|
|
|
|
#include "db/config.hh"
|
|
|
|
|
#include "utils/histogram.hh"
|
|
|
|
|
#include "replica/database.hh"
|
|
|
|
|
@@ -116,17 +115,17 @@ utils_json::estimated_histogram time_to_json_histogram(const utils::time_estimat
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static future<json::json_return_type> sum_estimated_histogram(http_context& ctx, utils::timed_rate_moving_average_summary_and_histogram service::storage_proxy_stats::stats::*f) {
|
|
|
|
|
return two_dimensional_map_reduce(ctx.sp, [f] (service::storage_proxy_stats::stats& stats) {
|
|
|
|
|
static future<json::json_return_type> sum_estimated_histogram(sharded<service::storage_proxy>& proxy, utils::timed_rate_moving_average_summary_and_histogram service::storage_proxy_stats::stats::*f) {
|
|
|
|
|
return two_dimensional_map_reduce(proxy, [f] (service::storage_proxy_stats::stats& stats) {
|
|
|
|
|
return (stats.*f).histogram();
|
|
|
|
|
}, utils::time_estimated_histogram_merge, utils::time_estimated_histogram()).then([](const utils::time_estimated_histogram& val) {
|
|
|
|
|
return make_ready_future<json::json_return_type>(time_to_json_histogram(val));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static future<json::json_return_type> sum_estimated_histogram(http_context& ctx, utils::estimated_histogram service::storage_proxy_stats::stats::*f) {
|
|
|
|
|
static future<json::json_return_type> sum_estimated_histogram(sharded<service::storage_proxy>& proxy, utils::estimated_histogram service::storage_proxy_stats::stats::*f) {
|
|
|
|
|
|
|
|
|
|
return two_dimensional_map_reduce(ctx.sp, f, utils::estimated_histogram_merge,
|
|
|
|
|
return two_dimensional_map_reduce(proxy, f, utils::estimated_histogram_merge,
|
|
|
|
|
utils::estimated_histogram()).then([](const utils::estimated_histogram& val) {
|
|
|
|
|
utils_json::estimated_histogram res;
|
|
|
|
|
res = val;
|
|
|
|
|
@@ -134,8 +133,8 @@ static future<json::json_return_type> sum_estimated_histogram(http_context& ctx
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static future<json::json_return_type> total_latency(http_context& ctx, utils::timed_rate_moving_average_summary_and_histogram service::storage_proxy_stats::stats::*f) {
|
|
|
|
|
return two_dimensional_map_reduce(ctx.sp, [f] (service::storage_proxy_stats::stats& stats) {
|
|
|
|
|
static future<json::json_return_type> total_latency(sharded<service::storage_proxy>& proxy, utils::timed_rate_moving_average_summary_and_histogram service::storage_proxy_stats::stats::*f) {
|
|
|
|
|
return two_dimensional_map_reduce(proxy, [f] (service::storage_proxy_stats::stats& stats) {
|
|
|
|
|
return (stats.*f).hist.mean * (stats.*f).hist.count;
|
|
|
|
|
}, std::plus<double>(), 0.0).then([](double val) {
|
|
|
|
|
int64_t res = val;
|
|
|
|
|
@@ -184,43 +183,43 @@ sum_timer_stats_storage_proxy(distributed<proxy>& d,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void set_storage_proxy(http_context& ctx, routes& r, sharded<service::storage_service>& ss) {
|
|
|
|
|
void set_storage_proxy(http_context& ctx, routes& r, sharded<service::storage_proxy>& proxy) {
|
|
|
|
|
sp::get_total_hints.set(r, [](std::unique_ptr<http::request> req) {
|
|
|
|
|
//TBD
|
|
|
|
|
unimplemented();
|
|
|
|
|
return make_ready_future<json::json_return_type>(0);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_hinted_handoff_enabled.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
const auto& filter = ctx.sp.local().get_hints_host_filter();
|
|
|
|
|
sp::get_hinted_handoff_enabled.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
const auto& filter = proxy.local().get_hints_host_filter();
|
|
|
|
|
return make_ready_future<json::json_return_type>(!filter.is_disabled_for_all());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::set_hinted_handoff_enabled.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
sp::set_hinted_handoff_enabled.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
auto enable = req->get_query_param("enable");
|
|
|
|
|
auto filter = (enable == "true" || enable == "1")
|
|
|
|
|
? db::hints::host_filter(db::hints::host_filter::enabled_for_all_tag {})
|
|
|
|
|
: db::hints::host_filter(db::hints::host_filter::disabled_for_all_tag {});
|
|
|
|
|
return ctx.sp.invoke_on_all([filter = std::move(filter)] (service::storage_proxy& sp) {
|
|
|
|
|
return proxy.invoke_on_all([filter = std::move(filter)] (service::storage_proxy& sp) {
|
|
|
|
|
return sp.change_hints_host_filter(filter);
|
|
|
|
|
}).then([] {
|
|
|
|
|
return make_ready_future<json::json_return_type>(json_void());
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_hinted_handoff_enabled_by_dc.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
sp::get_hinted_handoff_enabled_by_dc.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
std::vector<sstring> res;
|
|
|
|
|
const auto& filter = ctx.sp.local().get_hints_host_filter();
|
|
|
|
|
const auto& filter = proxy.local().get_hints_host_filter();
|
|
|
|
|
const auto& dcs = filter.get_dcs();
|
|
|
|
|
res.reserve(res.size());
|
|
|
|
|
std::copy(dcs.begin(), dcs.end(), std::back_inserter(res));
|
|
|
|
|
return make_ready_future<json::json_return_type>(res);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::set_hinted_handoff_enabled_by_dc_list.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
sp::set_hinted_handoff_enabled_by_dc_list.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
auto dcs = req->get_query_param("dcs");
|
|
|
|
|
auto filter = db::hints::host_filter::parse_from_dc_list(std::move(dcs));
|
|
|
|
|
return ctx.sp.invoke_on_all([filter = std::move(filter)] (service::storage_proxy& sp) {
|
|
|
|
|
return proxy.invoke_on_all([filter = std::move(filter)] (service::storage_proxy& sp) {
|
|
|
|
|
return sp.change_hints_host_filter(filter);
|
|
|
|
|
}).then([] {
|
|
|
|
|
return make_ready_future<json::json_return_type>(json_void());
|
|
|
|
|
@@ -342,144 +341,131 @@ void set_storage_proxy(http_context& ctx, routes& r, sharded<service::storage_se
|
|
|
|
|
return make_ready_future<json::json_return_type>(json_void());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_repair_attempted.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::read_repair_attempts);
|
|
|
|
|
sp::get_read_repair_attempted.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::read_repair_attempts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_repair_repaired_blocking.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::read_repair_repaired_blocking);
|
|
|
|
|
sp::get_read_repair_repaired_blocking.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::read_repair_repaired_blocking);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_repair_repaired_background.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::read_repair_repaired_background);
|
|
|
|
|
sp::get_read_repair_repaired_background.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::read_repair_repaired_background);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_schema_versions.set(r, [&ss](std::unique_ptr<http::request> req) {
|
|
|
|
|
return ss.local().describe_schema_versions().then([] (auto result) {
|
|
|
|
|
std::vector<sp::mapper_list> res;
|
|
|
|
|
for (auto e : result) {
|
|
|
|
|
sp::mapper_list entry;
|
|
|
|
|
entry.key = std::move(e.first);
|
|
|
|
|
entry.value = std::move(e.second);
|
|
|
|
|
res.emplace_back(std::move(entry));
|
|
|
|
|
}
|
|
|
|
|
return make_ready_future<json::json_return_type>(std::move(res));
|
|
|
|
|
});
|
|
|
|
|
sp::get_cas_read_timeouts.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &proxy::stats::cas_read_timeouts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_read_timeouts.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &proxy::stats::cas_read_timeouts);
|
|
|
|
|
sp::get_cas_read_unavailables.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &proxy::stats::cas_read_unavailables);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_read_unavailables.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &proxy::stats::cas_read_unavailables);
|
|
|
|
|
sp::get_cas_write_timeouts.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &proxy::stats::cas_write_timeouts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_write_timeouts.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &proxy::stats::cas_write_timeouts);
|
|
|
|
|
sp::get_cas_write_unavailables.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &proxy::stats::cas_write_unavailables);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_write_unavailables.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &proxy::stats::cas_write_unavailables);
|
|
|
|
|
sp::get_cas_write_metrics_unfinished_commit.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats(proxy, &proxy::stats::cas_write_unfinished_commit);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_write_metrics_unfinished_commit.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats(ctx.sp, &proxy::stats::cas_write_unfinished_commit);
|
|
|
|
|
sp::get_cas_write_metrics_contention.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_estimated_histogram(proxy, &proxy::stats::cas_write_contention);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_write_metrics_contention.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_estimated_histogram(ctx, &proxy::stats::cas_write_contention);
|
|
|
|
|
sp::get_cas_write_metrics_condition_not_met.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats(proxy, &proxy::stats::cas_write_condition_not_met);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_write_metrics_condition_not_met.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats(ctx.sp, &proxy::stats::cas_write_condition_not_met);
|
|
|
|
|
sp::get_cas_write_metrics_failed_read_round_optimization.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats(proxy, &proxy::stats::cas_failed_read_round_optimization);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_write_metrics_failed_read_round_optimization.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats(ctx.sp, &proxy::stats::cas_failed_read_round_optimization);
|
|
|
|
|
sp::get_cas_read_metrics_unfinished_commit.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats(proxy, &proxy::stats::cas_read_unfinished_commit);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_read_metrics_unfinished_commit.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_stats(ctx.sp, &proxy::stats::cas_read_unfinished_commit);
|
|
|
|
|
sp::get_cas_read_metrics_contention.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_estimated_histogram(proxy, &proxy::stats::cas_read_contention);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_read_metrics_contention.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_estimated_histogram(ctx, &proxy::stats::cas_read_contention);
|
|
|
|
|
sp::get_read_metrics_timeouts.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &service::storage_proxy_stats::stats::read_timeouts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_metrics_timeouts.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &service::storage_proxy_stats::stats::read_timeouts);
|
|
|
|
|
sp::get_read_metrics_unavailables.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &service::storage_proxy_stats::stats::read_unavailables);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_metrics_unavailables.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &service::storage_proxy_stats::stats::read_unavailables);
|
|
|
|
|
sp::get_range_metrics_timeouts.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &service::storage_proxy_stats::stats::range_slice_timeouts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_range_metrics_timeouts.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &service::storage_proxy_stats::stats::range_slice_timeouts);
|
|
|
|
|
sp::get_range_metrics_unavailables.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &service::storage_proxy_stats::stats::range_slice_unavailables);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_range_metrics_unavailables.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &service::storage_proxy_stats::stats::range_slice_unavailables);
|
|
|
|
|
sp::get_write_metrics_timeouts.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &service::storage_proxy_stats::stats::write_timeouts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_write_metrics_timeouts.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &service::storage_proxy_stats::stats::write_timeouts);
|
|
|
|
|
sp::get_write_metrics_unavailables.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(proxy, &service::storage_proxy_stats::stats::write_unavailables);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_write_metrics_unavailables.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_long(ctx.sp, &service::storage_proxy_stats::stats::write_unavailables);
|
|
|
|
|
sp::get_read_metrics_timeouts_rates.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(proxy, &service::storage_proxy_stats::stats::read_timeouts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_metrics_timeouts_rates.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(ctx.sp, &service::storage_proxy_stats::stats::read_timeouts);
|
|
|
|
|
sp::get_read_metrics_unavailables_rates.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(proxy, &service::storage_proxy_stats::stats::read_unavailables);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_metrics_unavailables_rates.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(ctx.sp, &service::storage_proxy_stats::stats::read_unavailables);
|
|
|
|
|
sp::get_range_metrics_timeouts_rates.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(proxy, &service::storage_proxy_stats::stats::range_slice_timeouts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_range_metrics_timeouts_rates.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(ctx.sp, &service::storage_proxy_stats::stats::range_slice_timeouts);
|
|
|
|
|
sp::get_range_metrics_unavailables_rates.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(proxy, &service::storage_proxy_stats::stats::range_slice_unavailables);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_range_metrics_unavailables_rates.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(ctx.sp, &service::storage_proxy_stats::stats::range_slice_unavailables);
|
|
|
|
|
sp::get_write_metrics_timeouts_rates.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(proxy, &service::storage_proxy_stats::stats::write_timeouts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_write_metrics_timeouts_rates.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(ctx.sp, &service::storage_proxy_stats::stats::write_timeouts);
|
|
|
|
|
sp::get_write_metrics_unavailables_rates.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(proxy, &service::storage_proxy_stats::stats::write_unavailables);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_write_metrics_unavailables_rates.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timed_rate_as_obj(ctx.sp, &service::storage_proxy_stats::stats::write_unavailables);
|
|
|
|
|
sp::get_range_metrics_latency_histogram_depricated.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_histogram_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::range);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_range_metrics_latency_histogram_depricated.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_histogram_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::range);
|
|
|
|
|
sp::get_write_metrics_latency_histogram_depricated.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_histogram_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::write);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_write_metrics_latency_histogram_depricated.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_histogram_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::write);
|
|
|
|
|
sp::get_read_metrics_latency_histogram_depricated.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_histogram_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::read);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_metrics_latency_histogram_depricated.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_histogram_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::read);
|
|
|
|
|
sp::get_range_metrics_latency_histogram.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::range);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_range_metrics_latency_histogram.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::range);
|
|
|
|
|
sp::get_write_metrics_latency_histogram.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::write);
|
|
|
|
|
});
|
|
|
|
|
sp::get_cas_write_metrics_latency_histogram.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats(proxy, &proxy::stats::cas_write);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_write_metrics_latency_histogram.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::write);
|
|
|
|
|
});
|
|
|
|
|
sp::get_cas_write_metrics_latency_histogram.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats(ctx.sp, &proxy::stats::cas_write);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_cas_read_metrics_latency_histogram.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats(ctx.sp, &proxy::stats::cas_read);
|
|
|
|
|
sp::get_cas_read_metrics_latency_histogram.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats(proxy, &proxy::stats::cas_read);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_view_write_metrics_latency_histogram.set(r, [](std::unique_ptr<http::request> req) {
|
|
|
|
|
@@ -490,31 +476,31 @@ void set_storage_proxy(http_context& ctx, routes& r, sharded<service::storage_se
|
|
|
|
|
return make_ready_future<json::json_return_type>(get_empty_moving_average());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_metrics_latency_histogram.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::read);
|
|
|
|
|
sp::get_read_metrics_latency_histogram.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::read);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_estimated_histogram.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_estimated_histogram(ctx, &service::storage_proxy_stats::stats::read);
|
|
|
|
|
sp::get_read_estimated_histogram.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_estimated_histogram(proxy, &service::storage_proxy_stats::stats::read);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_read_latency.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return total_latency(ctx, &service::storage_proxy_stats::stats::read);
|
|
|
|
|
sp::get_read_latency.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return total_latency(proxy, &service::storage_proxy_stats::stats::read);
|
|
|
|
|
});
|
|
|
|
|
sp::get_write_estimated_histogram.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_estimated_histogram(ctx, &service::storage_proxy_stats::stats::write);
|
|
|
|
|
sp::get_write_estimated_histogram.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_estimated_histogram(proxy, &service::storage_proxy_stats::stats::write);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_write_latency.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return total_latency(ctx, &service::storage_proxy_stats::stats::write);
|
|
|
|
|
sp::get_write_latency.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return total_latency(proxy, &service::storage_proxy_stats::stats::write);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_range_estimated_histogram.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats_storage_proxy(ctx.sp, &service::storage_proxy_stats::stats::range);
|
|
|
|
|
sp::get_range_estimated_histogram.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return sum_timer_stats_storage_proxy(proxy, &service::storage_proxy_stats::stats::range);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sp::get_range_latency.set(r, [&ctx](std::unique_ptr<http::request> req) {
|
|
|
|
|
return total_latency(ctx, &service::storage_proxy_stats::stats::range);
|
|
|
|
|
sp::get_range_latency.set(r, [&proxy](std::unique_ptr<http::request> req) {
|
|
|
|
|
return total_latency(proxy, &service::storage_proxy_stats::stats::range);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -547,7 +533,6 @@ void unset_storage_proxy(http_context& ctx, routes& r) {
|
|
|
|
|
sp::get_read_repair_attempted.unset(r);
|
|
|
|
|
sp::get_read_repair_repaired_blocking.unset(r);
|
|
|
|
|
sp::get_read_repair_repaired_background.unset(r);
|
|
|
|
|
sp::get_schema_versions.unset(r);
|
|
|
|
|
sp::get_cas_read_timeouts.unset(r);
|
|
|
|
|
sp::get_cas_read_unavailables.unset(r);
|
|
|
|
|
sp::get_cas_write_timeouts.unset(r);
|
|
|
|
|
|