hpx/performance_counters/performance_counter_set.hpp

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace performance_counters
class performance_counter_set

Public Functions

performance_counter_set(bool print_counters_locally = false)

Create an empty set of performance counters.

performance_counter_set(std::string const &names, bool reset = false)

Create a set of performance counters from a name, possibly containing wild-card characters

performance_counter_set(std::vector<std::string> const &names, bool reset = false)
void add_counters(std::string const &names, bool reset = false, error_code &ec = throws)

Add more performance counters to the set based on the given name, possibly containing wild-card characters

void add_counters(std::vector<std::string> const &names, bool reset = false, error_code &ec = throws)
std::vector<counter_info> get_counter_infos() const

Retrieve the counter infos for all counters in this set.

std::vector<hpx::future<counter_value>> get_counter_values(bool reset = false) const

Retrieve the values for all counters in this set supporting this operation

std::vector<counter_value> get_counter_values(launch::sync_policy, bool reset = false, error_code &ec = throws) const
std::vector<hpx::future<counter_values_array>> get_counter_values_array(bool reset = false) const

Retrieve the array-values for all counters in this set supporting this operation

std::vector<counter_values_array> get_counter_values_array(launch::sync_policy, bool reset = false, error_code &ec = throws) const
std::vector<hpx::future<void>> reset()

Reset all counters in this set.

void reset(launch::sync_policy, error_code &ec = throws)
std::vector<hpx::future<bool>> start()

Start all counters in this set.

bool start(launch::sync_policy, error_code &ec = throws)
std::vector<hpx::future<bool>> stop()

Stop all counters in this set.

bool stop(launch::sync_policy, error_code &ec = throws)
std::vector<hpx::future<void>> reinit(bool reset = true)

Re-initialize all counters in this set.

void reinit(launch::sync_policy, bool reset = true, error_code &ec = throws)
void release()

Release all references to counters in the set.

std::size_t size() const

Return the number of counters in this set.

template<typename T>
hpx::future<std::vector<T>> get_values(bool reset = false) const
template<typename T>
std::vector<T> get_values(launch::sync_policy, bool reset = false, error_code &ec = throws) const
std::size_t get_invocation_count() const

Protected Functions

bool find_counter(counter_info const &info, bool reset, error_code &ec)

Protected Static Functions

template<typename T>
static std::vector<T> extract_values(std::vector<hpx::future<counter_value>> &&values)

Private Types

typedef hpx::spinlock mutex_type

Private Members

mutex_type mtx_
std::vector<counter_info> infos_
std::vector<hpx::id_type> ids_
std::vector<std::uint8_t> reset_
std::uint64_t invocation_count_
bool print_counters_locally_