hpx/performance_counters/counters_fwd.hpp#

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

Defines

HPX_COUNTER_TYPE_UNSCOPED_ENUM_DEPRECATION_MSG#
HPX_COUNTER_STATUS_UNSCOPED_ENUM_DEPRECATION_MSG#
HPX_PERFORMANCE_COUNTER_V1#
HPX_DISCOVER_COUNTERS_MODE_UNSCOPED_ENUM_DEPRECATION_MSG#
namespace hpx
namespace performance_counters

Enums

enum class counter_type

Values:

enumerator text

text shows a variable-length text string. It does not deliver calculated values.

Formula: None Average: None Type: Text

enumerator raw

raw shows the last observed value only. It does not deliver an average.

Formula: None. Shows raw data as collected. Average: None Type: Instantaneous

enumerator monotonically_increasing

monotonically_increasing shows the cumulatively accumulated observed value. It does not deliver an average.

Formula: None. Shows cumulatively accumulated data as collected. Average: None Type: Instantaneous

enumerator average_base

average_base is used as the base data (denominator) in the computation of time or count averages for the counter_type::average_count and counter_type::average_timer counter types. This counter type collects the last observed value only.

Formula: None. This counter uses raw data in factional calculations without delivering an output. Average: SUM (N) / x Type: Instantaneous

enumerator average_count

average_count shows how many items are processed, on average, during an operation. Counters of this type display a ratio of the items processed (such as bytes sent) to the number of operations completed. The ratio is calculated by comparing the number of items processed during the last interval to the number of operations completed during the last interval.

Formula: (N1 - N0) / (D1 - D0), where the numerator (N) represents the number of items processed during the last sample interval, and the denominator (D) represents the number of operations completed during the last two sample intervals. Average: (Nx - N0) / (Dx - D0) Type: Average

enumerator aggregating

aggregating applies a function to an embedded counter instance. The embedded counter is usually evaluated repeatedly after a fixed (but configurable) time interval.

Formula: F(Nx)

enumerator average_timer

average_timer measures the average time it takes to complete a process or operation. Counters of this type display a ratio of the total elapsed time of the sample interval to the number of processes or operations completed during that time. This counter type measures time in ticks of the system clock. The variable F represents the number of ticks per second. The value of F is factored into the equation so that the result is displayed in seconds.

Formula: ((N1 - N0) / F) / (D1 - D0), where the numerator (N) represents the number of ticks counted during the last sample interval, the variable F represents the frequency of the ticks, and the denominator (D) represents the number of operations completed during the last sample interval. Average: ((Nx - N0) / F) / (Dx - D0) Type: Average

enumerator elapsed_time

elapsed_time shows the total time between when the component or process started and the time when this value is calculated. The variable F represents the number of time units that elapse in one second. The value of F is factored into the equation so that the result is displayed in seconds.

Formula: (D0 - N0) / F, where the nominator (D) represents the current time, the numerator (N) represents the time the object was started, and the variable F represents the number of time units that elapse in one second. Average: (Dx - N0) / F Type: Difference

enumerator histogram

histogram exposes a histogram of the measured values instead of a single value as many of the other counter types. Counters of this type expose a counter_value_array instead of a counter_value. Those will also not implement the get_counter_value() functionality. The results are exposed through a separate get_counter_values_array() function.

The first three values in the returned array represent the lower and upper boundaries, and the size of the histogram buckets. All remaining values in the returned array represent the number of measurements for each of the buckets in the histogram.

enumerator raw_values

raw_values exposes an array of measured values instead of a single value as many of the other counter types. Counters of this type expose a counter_value_array instead of a counter_value. Those will also not implement the get_counter_value() functionality. The results are exposed through a separate get_counter_values_array() function.

enumerator text
enumerator raw
enumerator monotonically_increasing
enumerator average_base
enumerator average_count
enumerator aggregating
enumerator average_timer
enumerator elapsed_time
enumerator histogram
enumerator raw_values

raw_values counter exposes an array of measured values instead of a single value as many of the other counter types. Counters of this type expose a counter_value_array instead of a counter_value. Those will also not implement the get_counter_value() functionality. The results are exposed through a separate get_counter_values_array() function.

enum class counter_status

Values:

enumerator valid_data

No error occurred, data is valid.

enumerator new_data

Data is valid and different from last call.

enumerator invalid_data

Some error occurred, data is not value.

enumerator already_defined

The type or instance already has been defined.

enumerator counter_unknown

The counter instance is unknown.

enumerator counter_type_unknown

The counter type is unknown.

enumerator generic_error

A unknown error occurred.

enumerator valid_data
enumerator new_data
enumerator invalid_data
enumerator already_defined
enumerator counter_unknown
enumerator counter_type_unknown
enumerator generic_error
enum class discover_counters_mode#

Values:

enumerator minimal#
enumerator full#

Functions

inline constexpr bool operator<(counter_type lhs, counter_type rhs) noexcept#
inline constexpr bool operator>(counter_type lhs, counter_type rhs) noexcept#
inline std::ostream &operator<<(std::ostream &os, counter_status const &rhs) noexcept#
counter_status get_counter_type_name(counter_type_path_elements const &path, std::string &result, error_code &ec = throws)#

Create a full name of a counter type from the contents of the given counter_type_path_elements instance.The generated counter type name will not contain any parameters.

counter_status get_full_counter_type_name(counter_type_path_elements const &path, std::string &result, error_code &ec = throws)#

Create a full name of a counter type from the contents of the given counter_type_path_elements instance. The generated counter type name will contain all parameters.

counter_status get_counter_name(counter_path_elements const &path, std::string &result, error_code &ec = throws)#

Create a full name of a counter from the contents of the given counter_path_elements instance.

counter_status get_counter_instance_name(counter_path_elements const &path, std::string &result, error_code &ec = throws)#

Create a name of a counter instance from the contents of the given counter_path_elements instance.

counter_status get_counter_type_path_elements(std::string const &name, counter_type_path_elements &path, error_code &ec = throws)#

Fill the given counter_type_path_elements instance from the given full name of a counter type.

counter_status get_counter_path_elements(std::string const &name, counter_path_elements &path, error_code &ec = throws)#

Fill the given counter_path_elements instance from the given full name of a counter.

counter_status get_counter_name(std::string const &name, std::string &countername, error_code &ec = throws)#

Return the canonical counter instance name from a given full instance name.

counter_status get_counter_type_name(std::string const &name, std::string &type_name, error_code &ec = throws)#

Return the canonical counter type name from a given (full) instance name.

HPX_DEPRECATED_V (1, 9, HPX_DISCOVER_COUNTERS_MODE_UNSCOPED_ENUM_DEPRECATION_MSG) inline const expr discover_counters_mode discover_counters_minimal
counter_status complement_counter_info(counter_info &info, counter_info const &type_info, error_code &ec = throws)#

Complement the counter info if parent instance name is missing.

counter_status complement_counter_info(counter_info &info, error_code &ec = throws)#
counter_status add_counter_type(counter_info const &info, create_counter_func const &create_counter, discover_counters_func const &discover_counters, error_code &ec = throws)#
counter_status discover_counter_types(discover_counter_func const &discover_counter, discover_counters_mode mode = discover_counters_mode::minimal, error_code &ec = throws)#

Call the supplied function for each registered counter type.

counter_status discover_counter_types(std::vector<counter_info> &counters, discover_counters_mode mode = discover_counters_mode::minimal, error_code &ec = throws)#

Return a list of all available counter descriptions.

counter_status discover_counter_type(std::string const &name, discover_counter_func const &discover_counter, discover_counters_mode mode = discover_counters_mode::minimal, error_code &ec = throws)#

Call the supplied function for the given registered counter type.

counter_status discover_counter_type(counter_info const &info, discover_counter_func const &discover_counter, discover_counters_mode mode = discover_counters_mode::minimal, error_code &ec = throws)#
counter_status discover_counter_type(std::string const &name, std::vector<counter_info> &counters, discover_counters_mode mode = discover_counters_mode::minimal, error_code &ec = throws)#

Return a list of matching counter descriptions for the given registered counter type.

counter_status discover_counter_type(counter_info const &info, std::vector<counter_info> &counters, discover_counters_mode mode = discover_counters_mode::minimal, error_code &ec = throws)#
bool expand_counter_info(counter_info const&, discover_counter_func const&, error_code&)#

call the supplied function will all expanded versions of the supplied counter info.

This function expands all locality#* and worker-thread#* wild cards only.

counter_status remove_counter_type(counter_info const &info, error_code &ec = throws)#

Remove an existing counter type from the (local) registry.

Note

This doesn’t remove existing counters of this type, it just inhibits defining new counters using this type.

counter_status get_counter_type(std::string const &name, counter_info &info, error_code &ec = throws)#

Retrieve the counter type for the given counter name from the (local) registry.

hpx::future<hpx::id_type> get_counter_async(std::string name, error_code &ec = throws)#

Get the global id of an existing performance counter, if the counter does not exist yet, the function attempts to create the counter based on the given counter name.

hpx::future<hpx::id_type> get_counter_async(counter_info const &info, error_code &ec = throws)#

Get the global id of an existing performance counter, if the counter does not exist yet, the function attempts to create the counter based on the given counter info.

void get_counter_infos(counter_info const &info, counter_type &type, std::string &helptext, std::uint32_t &version, error_code &ec = throws)#

Retrieve the meta data specific for the given counter instance.

void get_counter_infos(std::string name, counter_type &type, std::string &helptext, std::uint32_t &version, error_code &ec = throws)#

Retrieve the meta data specific for the given counter instance.

Variables

constexpr counter_type counter_text = counter_type::text#
constexpr counter_type counter_raw = counter_type::raw#
constexpr counter_type counter_monotonically_increasing = counter_type::monotonically_increasing#
constexpr counter_type counter_average_base = counter_type::average_base#
constexpr counter_type counter_average_count = counter_type::average_count#
constexpr counter_type counter_aggregating = counter_type::aggregating#
constexpr counter_type counter_average_timer = counter_type::average_timer#
constexpr counter_type counter_elapsed_time = counter_type::elapsed_time#
constexpr counter_type counter_raw_values = counter_type::raw_values#
constexpr counter_type counter_histogram = counter_type::histogram#
constexpr counter_status status_valid_data = counter_status::valid_data#
constexpr counter_status status_new_data = counter_status::new_data#
constexpr counter_status status_invalid_data = counter_status::invalid_data#
constexpr counter_status status_already_defined = counter_status::already_defined#
constexpr counter_status status_counter_unknown = counter_status::counter_unknown#
constexpr counter_status status_counter_type_unknown = counter_status::counter_type_unknown#
constexpr counter_status status_generic_error = counter_status::generic_error#
struct counter_value#

Public Functions

inline counter_value(std::int64_t value = 0, std::int64_t scaling = 1, bool scale_inverse = false)#
template<typename T>
inline T get_value(error_code &ec = throws) const#

Retrieve the ‘real’ value of the counter_value, converted to the requested type T.

Public Members

std::uint64_t time_#

The local time when data was collected.

std::uint64_t count_#

The invocation counter for the data.

std::int64_t value_#

The current counter value.

std::int64_t scaling_#

The scaling of the current counter value.

counter_status status_#

The status of the counter value.

bool scale_inverse_#

If true, value_ needs to be divided by scaling_, otherwise it has to be multiplied.

Private Functions

void serialize(serialization::output_archive &ar, const unsigned int)#
void serialize(serialization::input_archive &ar, const unsigned int)#

Friends

friend class hpx::serialization::access
struct counter_values_array#

Public Functions

inline counter_values_array(std::int64_t scaling = 1, bool scale_inverse = false)#
inline counter_values_array(std::vector<std::int64_t> &&values, std::int64_t scaling = 1, bool scale_inverse = false)#
inline counter_values_array(std::vector<std::int64_t> const &values, std::int64_t scaling = 1, bool scale_inverse = false)#
template<typename T>
inline T get_value(std::size_t index, error_code &ec = throws) const#

Retrieve the ‘real’ value of the counter_value, converted to the requested type T.

Public Members

std::uint64_t time_#

The local time when data was collected.

std::uint64_t count_#

The invocation counter for the data.

std::vector<std::int64_t> values_#

The current counter values.

std::int64_t scaling_#

The scaling of the current counter values.

counter_status status_#

The status of the counter value.

bool scale_inverse_#

If true, value_ needs to be divided by scaling_, otherwise it has to be multiplied.

Private Functions

void serialize(serialization::output_archive &ar, const unsigned int)#
void serialize(serialization::input_archive &ar, const unsigned int)#

Friends

friend class hpx::serialization::access