本文整理汇总了C++中request::get_statistics_counter_name方法的典型用法代码示例。如果您正苦于以下问题:C++ request::get_statistics_counter_name方法的具体用法?C++ request::get_statistics_counter_name怎么用?C++ request::get_statistics_counter_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::get_statistics_counter_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: statistics_counter
response locality_namespace::statistics_counter(
request const& req
, error_code& ec
)
{ // {{{ statistics_counter implementation
LAGAS_(info) << "locality_namespace::statistics_counter";
std::string name(req.get_statistics_counter_name());
performance_counters::counter_path_elements p;
performance_counters::get_counter_path_elements(name, p, ec);
if (ec) return response();
if (p.objectname_ != "agas")
{
HPX_THROWS_IF(ec, bad_parameter,
"locality_namespace::statistics_counter",
"unknown performance counter (unrelated to AGAS)");
return response();
}
namespace_action_code code = invalid_request;
detail::counter_target target = detail::counter_target_invalid;
for (std::size_t i = 0;
i != detail::num_locality_namespace_services;
++i)
{
if (p.countername_ == detail::locality_namespace_services[i].name_)
{
code = detail::locality_namespace_services[i].code_;
target = detail::locality_namespace_services[i].target_;
break;
}
}
if (code == invalid_request || target == detail::counter_target_invalid)
{
HPX_THROWS_IF(ec, bad_parameter,
"locality_namespace::statistics_counter",
"unknown performance counter (unrelated to AGAS)");
return response();
}
typedef locality_namespace::counter_data cd;
using util::placeholders::_1;
util::function_nonser<boost::int64_t(bool)> get_data_func;
if (target == detail::counter_target_count)
{
switch (code) {
case locality_ns_allocate:
get_data_func = util::bind(&cd::get_allocate_count,
&counter_data_, _1);
break;
case locality_ns_resolve_locality:
get_data_func = util::bind(&cd::get_resolve_locality_count,
&counter_data_, _1);
break;
case locality_ns_free:
get_data_func = util::bind(&cd::get_free_count,
&counter_data_, _1);
break;
case locality_ns_localities:
get_data_func = util::bind(&cd::get_localities_count,
&counter_data_, _1);
break;
case locality_ns_resolved_localities:
get_data_func = util::bind(&cd::get_resolved_localities_count,
&counter_data_, _1);
break;
case locality_ns_num_localities:
get_data_func = util::bind(&cd::get_num_localities_count,
&counter_data_, _1);
break;
case locality_ns_num_threads:
get_data_func = util::bind(&cd::get_num_threads_count,
&counter_data_, _1);
break;
case locality_ns_statistics_counter:
get_data_func = util::bind(&cd::get_overall_count, &counter_data_, _1);
break;
default:
HPX_THROWS_IF(ec, bad_parameter
, "locality_namespace::statistics"
, "bad action code while querying statistics");
return response();
}
}
else {
HPX_ASSERT(detail::counter_target_time == target);
switch (code) {
case locality_ns_allocate:
get_data_func = util::bind(&cd::get_allocate_time,
&counter_data_, _1);
break;
case locality_ns_resolve_locality:
get_data_func = util::bind(&cd::get_resolve_locality_time,
&counter_data_, _1);
break;
case locality_ns_free:
//.........这里部分代码省略.........