# performance_counters¶

The contents of this module can be included with the header hpx/modules/performance_counters.hpp. These headers may be used by user-code but are not guaranteed stable (neither header location nor contents). You are using these at your own risk. If you wish to use non-public functionality from a module we strongly suggest only including the module header hpx/modules/performance_counters.hpp, not the particular header in which the functionality you would like to use is defined. See Public API for a list of names that are part of the public HPX API.

namespace hpx
namespace performance_counters

Functions

bool action_invocation_counter_discoverer(hpx::actions::detail::invocation_count_registry const &registry, counter_info const &info, counter_path_elements &p, discover_counter_func const &f, discover_counters_mode mode, error_code &ec)
namespace hpx
namespace performance_counters
template<typename Derived>
class base_performance_counter

Public Types

typedef Derived type_holder
typedef hpx::performance_counters::server::base_performance_counter base_type_holder

Public Functions

base_performance_counter()
base_performance_counter(hpx::performance_counters::counter_info const &info)
void finalize()

Private Types

typedef hpx::components::component_base<Derived> base_type
namespace hpx
namespace performance_counters

Functions

bool default_counter_discoverer(counter_info const&, discover_counter_func const&, discover_counters_mode, error_code&)

Default discovery function for performance counters; to be registered with the counter types. It will pass the counter_info and the error_code to the supplied function.

bool locality_counter_discoverer(counter_info const&, discover_counter_func const&, discover_counters_mode, error_code&)

Default discoverer function for performance counters; to be registered with the counter types. It is suitable to be used for all counters following the naming scheme:

/<objectname>(locality#<locality_id>/total)/<instancename>

bool locality_pool_counter_discoverer(counter_info const&, discover_counter_func const&, discover_counters_mode, error_code&)

Default discoverer function for performance counters; to be registered with the counter types. It is suitable to be used for all counters following the naming scheme:

/<objectname>(locality#<locality_id>/pool#<pool_name>/total)/<instancename>

bool locality0_counter_discoverer(counter_info const&, discover_counter_func const&, discover_counters_mode, error_code&)

Default discoverer function for AGAS performance counters; to be registered with the counter types. It is suitable to be used for all counters following the naming scheme:

/<objectname>{locality#0/total}/<instancename>

bool locality_thread_counter_discoverer(counter_info const&, discover_counter_func const&, discover_counters_mode, error_code&)

Default discoverer function for performance counters; to be registered with the counter types. It is suitable to be used for all counters following the naming scheme:

bool locality_pool_thread_counter_discoverer(counter_info const &info, discover_counter_func const &f, discover_counters_mode mode, error_code &ec)

Default discoverer function for performance counters; to be registered with the counter types. It is suitable to be used for all counters following the naming scheme:

bool locality_pool_thread_no_total_counter_discoverer(counter_info const &info, discover_counter_func const &f, discover_counters_mode mode, error_code &ec)

Default discoverer function for performance counters; to be registered with the counter types. It is suitable to be used for all counters following the naming scheme:

This is essentially the same as above just that locality#*/total is not supported.

bool locality_numa_counter_discoverer(counter_info const&, discover_counter_func const&, discover_counters_mode, error_code&)

Default discoverer function for performance counters; to be registered with the counter types. It is suitable to be used for all counters following the naming scheme:

naming::gid_type locality_raw_counter_creator(counter_info const&, hpx::util::function_nonser<std::int64_t(bool)> const&, error_code&, )

Creation function for raw counters. The passed function is encapsulating the actual value to monitor. This function checks the validity of the supplied counter name, it has to follow the scheme:

/<objectname>(locality#<locality_id>/total)/<instancename>

naming::gid_type locality_raw_values_counter_creator(counter_info const&, hpx::util::function_nonser<std::vector<std::int64_t>(bool)> const&, error_code&, )
naming::gid_type agas_raw_counter_creator(counter_info const&, error_code&, char const*const)

Creation function for raw counters. The passed function is encapsulating the actual value to monitor. This function checks the validity of the supplied counter name, it has to follow the scheme:

/agas(<objectinstance>/total)/<instancename>

bool agas_counter_discoverer(counter_info const&, discover_counter_func const&, discover_counters_mode, error_code&)

Default discoverer function for performance counters; to be registered with the counter types. It is suitable to be used for all counters following the naming scheme:

/agas(<objectinstance>/total)/<instancename>

naming::gid_type local_action_invocation_counter_creator(counter_info const&, error_code&)
bool local_action_invocation_counter_discoverer(counter_info const&, discover_counter_func const&, discover_counters_mode, error_code&)
namespace hpx
namespace performance_counters

Functions

bool parse_counter_name(std::string const &name, path_elements &elements)
struct instance_elements

Public Members

instance_name parent_
instance_name child_
instance_name subchild_
struct instance_name

Public Members

std::string name_
std::string index_
bool basename_ = false
struct path_elements

Public Members

std::string object_
instance_elements instance_
std::string counter_
std::string parameters_
namespace hpx
namespace performance_counters

Typedefs

typedef hpx::util::function_nonser<naming::gid_type(counter_info const&, error_code&)> create_counter_func

This declares the type of a function, which will be called by HPX whenever a new performance counter instance of a particular type needs to be created.

typedef hpx::util::function_nonser<bool(counter_info const&, error_code&)> discover_counter_func

This declares a type of a function, which will be passed to a discover_counters_func in order to be called for each discovered performance counter instance.

typedef hpx::util::function_nonser<bool(counter_info const&, discover_counter_func const&, discover_counters_mode, error_code&)> discover_counters_func

This declares the type of a function, which will be called by HPX whenever it needs to discover all performance counter instances of a particular type.

Enums

enum counter_type

Values:

counter_text

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

Formula: None Average: None Type: Text

counter_raw

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

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

counter_monotonically_increasing
counter_average_base

counter_average_base is used as the base data (denominator) in the computation of time or count averages for the counter_average_count and counter_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

counter_average_count

counter_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

counter_aggregating

counter_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)

counter_average_timer

counter_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

counter_elapsed_time

counter_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

counter_histogram

counter_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.

counter_raw_values

counter_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.

counter_text

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

Formula: None Average: None Type: Text

counter_raw

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

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

counter_monotonically_increasing
counter_average_base

counter_average_base is used as the base data (denominator) in the computation of time or count averages for the counter_average_count and counter_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

counter_average_count

counter_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

counter_aggregating

counter_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)

counter_average_timer

counter_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

counter_elapsed_time

counter_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

counter_histogram

counter_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.

counter_raw_values

counter_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.

enum counter_status

Status and error codes used by the functions related to performance counters.

Values:

status_valid_data

No error occurred, data is valid.

status_new_data

Data is valid and different from last call.

status_invalid_data

Some error occurred, data is not value.

status_already_defined

The type or instance already has been defined.

status_counter_unknown

The counter instance is unknown.

status_counter_type_unknown

The counter type is unknown.

status_generic_error

A unknown error occurred.

status_valid_data

No error occurred, data is valid.

status_new_data

Data is valid and different from last call.

status_invalid_data

Some error occurred, data is not value.

status_already_defined

The type or instance already has been defined.

status_counter_unknown

The counter instance is unknown.

status_counter_type_unknown

The counter type is unknown.

status_generic_error

A unknown error occurred.

Functions

std::string &ensure_counter_prefix(std::string &name)
std::string ensure_counter_prefix(std::string const &counter)
std::string &remove_counter_prefix(std::string &name)
std::string remove_counter_prefix(std::string const &counter)
char const *get_counter_type_name(counter_type state)

Return the readable name of a given counter type.

bool status_is_valid(counter_status s)
counter_status add_counter_type(counter_info const &info, error_code &ec)
naming::id_type get_counter(std::string const &name, error_code &ec)
naming::id_type get_counter(counter_info const &info, error_code &ec)

Variables

constexpr const char counter_prefix[] = "/counters"
constexpr std::size_t counter_prefix_len = (sizeof(counter_prefix) / sizeof(counter_prefix[0])) - 1
struct counter_info

Public Functions

counter_info(counter_type type = counter_raw)
counter_info(std::string const &name)
counter_info(counter_type type, std::string const &name, std::string const &helptext = "", std::uint32_t version = HPX_PERFORMANCE_COUNTER_V1, std::string const &uom = "")

Public Members

counter_type type_

The type of the described counter.

std::uint32_t version_

The version of the described counter using the 0xMMmmSSSS scheme

counter_status status_

The status of the counter object.

std::string fullname_

The full name of this counter.

std::string helptext_

The full descriptive text for this counter.

std::string unit_of_measure_

The unit of measure for this counter.

Private Functions

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

Friends

friend hpx::performance_counters::hpx::serialization::access
struct counter_path_elements : public hpx::performance_counters::counter_type_path_elements
#include <counters.hpp>

A counter_path_elements holds the elements of a full name for a counter instance. Generally, a full name of a counter instance has the structure:

/objectname{parentinstancename::parentindex/instancename#instanceindex} /countername#parameters

Public Types

typedef counter_type_path_elements base_type

Public Functions

counter_path_elements()
counter_path_elements(std::string const &objectname, std::string const &countername, std::string const &parameters, std::string const &parentname, std::string const &instancename, std::int64_t parentindex = -1, std::int64_t instanceindex = -1, bool parentinstance_is_basename = false)
counter_path_elements(std::string const &objectname, std::string const &countername, std::string const &parameters, std::string const &parentname, std::string const &instancename, std::string const &subinstancename, std::int64_t parentindex = -1, std::int64_t instanceindex = -1, std::int64_t subinstanceindex = -1, bool parentinstance_is_basename = false)

Public Members

std::string parentinstancename_

the name of the parent instance

std::string instancename_

the name of the object instance

std::string subinstancename_

the name of the object sub-instance

std::int64_t parentinstanceindex_

the parent instance index

std::int64_t instanceindex_

the instance index

std::int64_t subinstanceindex_

the sub-instance index

bool parentinstance_is_basename_

the parentinstancename_

Private Functions

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

Friends

friend hpx::performance_counters::hpx::serialization::access

member holds a base counter name

struct counter_type_path_elements
#include <counters.hpp>

A counter_type_path_elements holds the elements of a full name for a counter type. Generally, a full name of a counter type has the structure:

/objectname/countername

i.e. /queue/length

Subclassed by hpx::performance_counters::counter_path_elements

Public Functions

counter_type_path_elements()
counter_type_path_elements(std::string const &objectname, std::string const &countername, std::string const &parameters)

Public Members

std::string objectname_

the name of the performance object

std::string countername_

contains the counter name

std::string parameters_

optional parameters for the counter instance

Protected Functions

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

Friends

friend hpx::performance_counters::hpx::serialization::access

Defines

HPX_PERFORMANCE_COUNTER_V1
namespace hpx
namespace performance_counters

Enums

enum counter_type

Values:

counter_text

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

Formula: None Average: None Type: Text

counter_raw

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

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

counter_monotonically_increasing
counter_average_base

counter_average_base is used as the base data (denominator) in the computation of time or count averages for the counter_average_count and counter_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

counter_average_count

counter_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

counter_aggregating

counter_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)

counter_average_timer

counter_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

counter_elapsed_time

counter_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

counter_histogram

counter_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.

counter_raw_values

counter_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.

counter_text

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

Formula: None Average: None Type: Text

counter_raw

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

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

counter_monotonically_increasing
counter_average_base

counter_average_base is used as the base data (denominator) in the computation of time or count averages for the counter_average_count and counter_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

counter_average_count

counter_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

counter_aggregating

counter_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)

counter_average_timer

counter_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

counter_elapsed_time

counter_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

counter_histogram

counter_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.

counter_raw_values

counter_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.

enum counter_status

Values:

status_valid_data

No error occurred, data is valid.

status_new_data

Data is valid and different from last call.

status_invalid_data

Some error occurred, data is not value.

status_already_defined

The type or instance already has been defined.

status_counter_unknown

The counter instance is unknown.

status_counter_type_unknown

The counter type is unknown.

status_generic_error

A unknown error occurred.

status_valid_data

No error occurred, data is valid.

status_new_data

Data is valid and different from last call.

status_invalid_data

Some error occurred, data is not value.

status_already_defined

The type or instance already has been defined.

status_counter_unknown

The counter instance is unknown.

status_counter_type_unknown

The counter type is unknown.

status_generic_error

A unknown error occurred.

enum discover_counters_mode

Values:

discover_counters_minimal
discover_counters_full

Functions

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.

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_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_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_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_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_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_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.

lcos::future<naming::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.

lcos::future<naming::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.

struct counter_value

Public Functions

counter_value(std::int64_t value = 0, std::int64_t scaling = 1, bool scale_inverse = false)
template<typename T>
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 hpx::performance_counters::hpx::serialization::access
struct counter_values_array

Public Functions

counter_values_array(std::int64_t scaling = 1, bool scale_inverse = false)
counter_values_array(std::vector<std::int64_t> &&values, std::int64_t scaling = 1, bool scale_inverse = false)
counter_values_array(std::vector<std::int64_t> const &values, std::int64_t scaling = 1, bool scale_inverse = false)
template<typename T>
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 hpx::performance_counters::hpx::serialization::access
namespace hpx
namespace performance_counters

Functions

void install_counter(naming::id_type const &id, counter_info const &info, error_code &ec = throws)

Install a new performance counter in a way, which will uninstall it automatically during shutdown.

namespace hpx
namespace performance_counters

Functions

counter_status install_counter_type(std::string const &name, hpx::util::function_nonser<std::int64_t(bool)> const &counter_value, std::string const &helptext = "", std::string const &uom = "", counter_type type = counter_raw, error_code &ec = throws, )

Install a new generic performance counter type in a way, which will uninstall it automatically during shutdown.

The function install_counter_type will register a new generic counter type based on the provided function. The counter type will be automatically unregistered during system shutdown. Any consumer querying any instance of this this counter type will cause the provided function to be called and the returned value to be exposed as the counter value.

The counter type is registered such that there can be one counter instance per locality. The expected naming scheme for the counter instances is: '/objectname{locality#<*>/total}/countername' where ‘<*>’ is a zero based integer identifying the locality the counter is created on.

Note

As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.

Return

If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).

Note

The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.

Parameters
• name: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.

• counter_value: [in] The function to call whenever the counter value is requested by a consumer.

• helptext: [in, optional] A longer descriptive text shown to the user to explain the nature of the counters created from this type.

• uom: [in] The unit of measure for the new performance counter type.

• type: [in] Type for the new performance counter type.

• ec: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

counter_status install_counter_type(std::string const &name, hpx::util::function_nonser<std::vector<std::int64_t>(bool)> const &counter_value, std::string const &helptext = "", std::string const &uom = "", error_code &ec = throws, )

Install a new generic performance counter type returning an array of values in a way, that will uninstall it automatically during shutdown.

The function install_counter_type will register a new generic counter type that returns an array of values based on the provided function. The counter type will be automatically unregistered during system shutdown. Any consumer querying any instance of this this counter type will cause the provided function to be called and the returned array value to be exposed as the counter value.

The counter type is registered such that there can be one counter instance per locality. The expected naming scheme for the counter instances is: '/objectname{locality#<*>/total}/countername' where ‘<*>’ is a zero based integer identifying the locality the counter is created on.

Note

As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.

Return

If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).

Note

The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.

Parameters
• name: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.

• counter_value: [in] The function to call whenever the counter value (array of values) is requested by a consumer.

• helptext: [in, optional] A longer descriptive text shown to the user to explain the nature of the counters created from this type.

• uom: [in] The unit of measure for the new performance counter type.

• ec: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

void install_counter_type(std::string const &name, counter_type type, error_code &ec = throws)

Install a new performance counter type in a way, which will uninstall it automatically during shutdown.

The function install_counter_type will register a new counter type based on the provided counter_type_info. The counter type will be automatically unregistered during system shutdown.

Return

If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).

Note

The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.

Note

As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.

Parameters
• name: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.

• type: [in] The type of the counters of this counter_type.

• ec: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

counter_status install_counter_type(std::string const &name, counter_type type, std::string const &helptext, std::string const &uom = "", std::uint32_t version = HPX_PERFORMANCE_COUNTER_V1, error_code &ec = throws)

Install a new performance counter type in a way, which will uninstall it automatically during shutdown.

The function install_counter_type will register a new counter type based on the provided counter_type_info. The counter type will be automatically unregistered during system shutdown.

Return

If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).

Note

The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.

Note

As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.

Parameters
• name: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.

• type: [in] The type of the counters of this counter_type.

• helptext: [in] A longer descriptive text shown to the user to explain the nature of the counters created from this type.

• uom: [in] The unit of measure for the new performance counter type.

• version: [in] The version of the counter type. This is currently expected to be set to HPX_PERFORMANCE_COUNTER_V1.

• ec: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

counter_status install_counter_type(std::string const &name, counter_type type, std::string const &helptext, create_counter_func const &create_counter, discover_counters_func const &discover_counters, std::uint32_t version = HPX_PERFORMANCE_COUNTER_V1, std::string const &uom = "", error_code &ec = throws)

Install a new generic performance counter type in a way, which will uninstall it automatically during shutdown.

The function install_counter_type will register a new generic counter type based on the provided counter_type_info. The counter type will be automatically unregistered during system shutdown.

Note

As long as ec is not pre-initialized to hpx::throws this function doesn’t throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.

Return

If successful, this function returns status_valid_data, otherwise it will either throw an exception or return an error_code from the enum counter_status (also, see note related to parameter ec).

Note

The counter type registry is a locality based service. You will have to register each counter type on every locality where a corresponding performance counter will be created.

Parameters
• name: [in] The global virtual name of the counter type. This name is expected to have the format /objectname/countername.

• type: [in] The type of the counters of this counter_type.

• helptext: [in] A longer descriptive text shown to the user to explain the nature of the counters created from this type.

• version: [in] The version of the counter type. This is currently expected to be set to HPX_PERFORMANCE_COUNTER_V1.

• create_counter: [in] The function which will be called to create a new instance of this counter type.

• discover_counters: [in] The function will be called to discover counter instances which can be created.

• uom: [in] The unit of measure of the counter type (default: “”)

• ec: [in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

namespace hpx
namespace performance_counters

Functions

std::vector<performance_counter> discover_counters(std::string const &name, error_code &ec = throws)
struct performance_counter : public components::client_base<performance_counter, server::base_performance_counter>

Public Types

using base_type = components::client_base<performance_counter, server::base_performance_counter>

Public Functions

performance_counter()
performance_counter(std::string const &name)
performance_counter(std::string const &name, hpx::id_type const &locality)
performance_counter(id_type const &id)
performance_counter(future<id_type> &&id)
performance_counter(hpx::future<performance_counter> &&c)
future<counter_info> get_info() const
counter_info get_info(launch::sync_policy, error_code &ec = throws) const
future<counter_value> get_counter_value(bool reset = false)
counter_value get_counter_value(launch::sync_policy, bool reset = false, error_code &ec = throws)
future<counter_value> get_counter_value() const
counter_value get_counter_value(launch::sync_policy, error_code &ec = throws) const
future<counter_values_array> get_counter_values_array(bool reset = false)
counter_values_array get_counter_values_array(launch::sync_policy, bool reset = false, error_code &ec = throws)
future<counter_values_array> get_counter_values_array() const
counter_values_array get_counter_values_array(launch::sync_policy, error_code &ec = throws) const
future<bool> start()
bool start(launch::sync_policy, error_code &ec = throws)
future<bool> stop()
bool stop(launch::sync_policy, error_code &ec = throws)
future<void> reset()
void reset(launch::sync_policy, error_code &ec = throws)
future<void> reinit(bool reset = true)
void reinit(launch::sync_policy, bool reset = true, error_code &ec = throws)
future<std::string> get_name() const
std::string get_name(launch::sync_policy, error_code &ec = throws) const
template<typename T>
future<T> get_value(bool reset = false)
template<typename T>
T get_value(launch::sync_policy, bool reset = false, error_code &ec = throws)
template<typename T>
future<T> get_value() const
template<typename T>
T get_value(launch::sync_policy, error_code &ec = throws) const

Private Static Functions

template<typename T>
static T extract_value(future<counter_value> &&value)
namespace hpx
namespace performance_counters
struct performance_counter_base

Public Functions

virtual ~performance_counter_base()

Destructor, needs to be virtual to allow for clean destruction of derived objects

virtual counter_info get_counter_info() const = 0
virtual counter_value get_counter_value(bool reset = false) = 0
virtual counter_values_array get_counter_values_array(bool reset = false) = 0
virtual void reset_counter_value() = 0
virtual void set_counter_value(counter_value const&) = 0
virtual bool start() = 0
virtual bool stop() = 0
virtual void reinit(bool reset) = 0
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 lcos::local::spinlock mutex_type

Private Members

mutex_type mtx_
std::vector<counter_info> infos_
std::vector<naming::id_type> ids_
std::vector<std::uint8_t> reset_
std::uint64_t invocation_count_
bool print_counters_locally_
namespace hpx
namespace performance_counters
class registry

Public Functions

registry()
void clear()

Reset registry by deleting all stored counter types.

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)

Add a new performance counter type to the (local) registry.

counter_status discover_counter_types(discover_counter_func discover_counter, discover_counters_mode mode, error_code &ec = throws)

Call the supplied function for all registered counter types.

counter_status discover_counter_type(std::string const &fullname, discover_counter_func discover_counter, discover_counters_mode mode, 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 &f, discover_counters_mode mode, error_code &ec = throws)
counter_status get_counter_create_function(counter_info const &info, create_counter_func &create_counter, error_code &ec = throws) const

Retrieve the counter creation function which is associated with a given counter type.

counter_status get_counter_discovery_function(counter_info const &info, discover_counters_func &func, error_code &ec) const

Retrieve the counter discovery function which is associated with a given counter type.

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 create_raw_counter_value(counter_info const &info, std::int64_t *countervalue, naming::gid_type &id, error_code &ec = throws)

Create a new performance counter instance of type raw_counter based on given counter value.

counter_status create_raw_counter(counter_info const &info, hpx::util::function_nonser<std::int64_t()> const &fnaming::gid_type &id, error_code &ec = throws, )

Create a new performance counter instance of type raw_counter based on given function returning the counter value.

counter_status create_raw_counter(counter_info const &info, hpx::util::function_nonser<std::int64_t(bool)> const &f, naming::gid_type &id, error_code &ec = throws, )

Create a new performance counter instance of type raw_counter based on given function returning the counter value.

counter_status create_raw_counter(counter_info const &info, hpx::util::function_nonser<std::vector<std::int64_t>()> const &fnaming::gid_type &id, error_code &ec = throws, )

Create a new performance counter instance of type raw_counter based on given function returning the counter value.

counter_status create_raw_counter(counter_info const &info, hpx::util::function_nonser<std::vector<std::int64_t>(bool)> const &f, naming::gid_type &id, error_code &ec = throws, )

Create a new performance counter instance of type raw_counter based on given function returning the counter value.

counter_status create_counter(counter_info const &info, naming::gid_type &id, error_code &ec = throws)

Create a new performance counter instance based on given counter info.

counter_status create_statistics_counter(counter_info const &info, std::string const &base_counter_name, std::vector<std::size_t> const &parameters, naming::gid_type &id, error_code &ec = throws)

Create a new statistics performance counter instance based on given base counter name and given base time interval (milliseconds).

counter_status create_arithmetics_counter(counter_info const &info, std::vector<std::string> const &base_counter_names, naming::gid_type &id, error_code &ec = throws)

Create a new arithmetics performance counter instance based on given base counter names.

counter_status create_arithmetics_counter_extended(counter_info const &info, std::vector<std::string> const &base_counter_names, naming::gid_type &id, error_code &ec = throws)

Create a new extended arithmetics performance counter instance based on given base counter names.

counter_status add_counter(naming::id_type const &id, counter_info const &info, error_code &ec = throws)

Add an existing performance counter instance to the registry.

counter_status remove_counter(counter_info const &info, naming::id_type const &id, error_code &ec = throws)

remove the existing performance counter from the registry

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

Retrieve counter type information for given counter name.

Public Static Functions

static registry &instance()

Protected Functions

counter_type_map_type::iterator locate_counter_type(std::string const &type_name)
counter_type_map_type::const_iterator locate_counter_type(std::string const &type_name) const

Private Types

typedef std::map<std::string, counter_data> counter_type_map_type

Private Members

counter_type_map_type countertypes_
struct counter_data

Public Functions

counter_data(counter_info const &info, create_counter_func const &create_counter, discover_counters_func const &discover_counters)

Public Members

counter_info info_
create_counter_func create_counter_
discover_counters_func discover_counters_
namespace hpx
namespace performance_counters
namespace server
template<typename Operation>
class arithmetics_counter : public hpx::performance_counters::server::base_performance_counter, public components::component_base<arithmetics_counter<Operation>>

Public Types

typedef arithmetics_counter type_holder
typedef base_performance_counter base_type_holder

Public Functions

arithmetics_counter()
arithmetics_counter(counter_info const &info, std::vector<std::string> const &base_counter_names)
hpx::performance_counters::counter_value get_counter_value(bool reset = false)

Overloads from the base_counter base class.

bool start()
bool stop()
void reset_counter_value()

the following functions are not implemented by default, they will just throw

void finalize()

Private Types

typedef components::component_base<arithmetics_counter<Operation>> base_type

Private Members

performance_counter_set counters_
namespace hpx
namespace performance_counters
namespace server
template<typename Statistic>
class arithmetics_counter_extended : public hpx::performance_counters::server::base_performance_counter, public components::component_base<arithmetics_counter_extended<Statistic>>

Public Types

typedef arithmetics_counter_extended type_holder
typedef base_performance_counter base_type_holder

Public Functions

arithmetics_counter_extended()
arithmetics_counter_extended(counter_info const &info, std::vector<std::string> const &base_counter_names)
hpx::performance_counters::counter_value get_counter_value(bool reset = false)

Overloads from the base_counter base class.

bool start()
bool stop()
void reset_counter_value()

the following functions are not implemented by default, they will just throw

void finalize()

Private Types

typedef components::component_base<arithmetics_counter_extended<Statistic>> base_type

Private Members

performance_counter_set counters_
namespace hpx
namespace performance_counters
namespace server
class base_performance_counter : public hpx::performance_counters::performance_counter_base, public component_tag

Public Types

typedef components::component<base_performance_counter> wrapping_type
typedef base_performance_counter base_type_holder

Public Functions

base_performance_counter()
base_performance_counter(counter_info const &info)
void finalize()

finalize() will be called just before the instance gets destructed

counter_info get_counter_info_nonvirt() const
counter_value get_counter_value_nonvirt(bool reset)
counter_values_array get_counter_values_array_nonvirt(bool reset)
void set_counter_value_nonvirt(counter_value const &info)
void reset_counter_value_nonvirt()
bool start_nonvirt()
bool stop_nonvirt()
void reinit_nonvirt(bool reset)
HPX_DEFINE_COMPONENT_ACTION(base_performance_counter, get_counter_info_nonvirt, get_counter_info_action)

Each of the exposed functions needs to be encapsulated into an action type, allowing to generate all required boilerplate code for threads, serialization, etc. The get_counter_info_action retrieves a performance counters information.

HPX_DEFINE_COMPONENT_ACTION(base_performance_counter, get_counter_value_nonvirt, get_counter_value_action)

The get_counter_value_action queries the value of a performance counter.

HPX_DEFINE_COMPONENT_ACTION(base_performance_counter, get_counter_values_array_nonvirt, get_counter_values_array_action)

The get_counter_value_action queries the value of a performance counter.

HPX_DEFINE_COMPONENT_ACTION(base_performance_counter, set_counter_value_nonvirt, set_counter_value_action)

The set_counter_value_action.

HPX_DEFINE_COMPONENT_ACTION(base_performance_counter, reset_counter_value_nonvirt, reset_counter_value_action)

The reset_counter_value_action.

HPX_DEFINE_COMPONENT_ACTION(base_performance_counter, start_nonvirt, start_action)

The start_action.

HPX_DEFINE_COMPONENT_ACTION(base_performance_counter, stop_nonvirt, stop_action)

The stop_action.

HPX_DEFINE_COMPONENT_ACTION(base_performance_counter, reinit_nonvirt, reinit_action)

The reinit_action.

Public Static Functions

static components::component_type get_component_type()
static void set_component_type(components::component_type t)

Protected Functions

virtual void reset_counter_value()

the following functions are not implemented by default, they will just throw

virtual void set_counter_value(counter_value const&)
virtual counter_value get_counter_value(bool)
virtual counter_values_array get_counter_values_array(bool)
virtual bool start()
virtual bool stop()
virtual void reinit(bool)
virtual counter_info get_counter_info() const

Protected Attributes

hpx::performance_counters::counter_info info_
util::atomic_count invocation_count_
namespace hpx
namespace performance_counters
namespace server
class elapsed_time_counter : public hpx::performance_counters::server::base_performance_counter, public components::component_base<elapsed_time_counter>

Public Types

typedef elapsed_time_counter type_holder
typedef base_performance_counter base_type_holder

Public Functions

elapsed_time_counter()
elapsed_time_counter(counter_info const &info)
hpx::performance_counters::counter_value get_counter_value(bool reset)
void reset_counter_value()

the following functions are not implemented by default, they will just throw

bool start()
bool stop()
void finalize()

finalize() will be called just before the instance gets destructed

Private Types

typedef components::component_base<elapsed_time_counter> base_type
namespace hpx
namespace agas

Functions

void primary_namespace_register_counter_types(error_code &ec = throws)
naming::gid_type primary_namespace_statistics_counter(std::string const &name)
HPX_DEFINE_PLAIN_ACTION(primary_namespace_statistics_counter, primary_namespace_statistics_counter_action)
namespace hpx
namespace performance_counters
namespace server
class raw_counter : public hpx::performance_counters::server::base_performance_counter, public components::component_base<raw_counter>

Public Types

typedef raw_counter type_holder
typedef base_performance_counter base_type_holder

Public Functions

raw_counter()
raw_counter(counter_info const &info, hpx::util::function_nonser<std::int64_t(bool)> f)
hpx::performance_counters::counter_value get_counter_value(bool reset = false)
void reset_counter_value()

the following functions are not implemented by default, they will just throw

void finalize()

finalize() will be called just before the instance gets destructed

Private Types

typedef components::component_base<raw_counter> base_type

Private Members

hpx::util::function_nonser<std::int64_t(bool)> f_
bool reset_
namespace hpx
namespace performance_counters
namespace server
class raw_values_counter : public hpx::performance_counters::server::base_performance_counter, public components::component_base<raw_values_counter>

Public Types

typedef raw_values_counter type_holder
typedef base_performance_counter base_type_holder

Public Functions

raw_values_counter()
raw_values_counter(counter_info const &info, hpx::util::function_nonser<std::vector<std::int64_t>(bool)> f)
hpx::performance_counters::counter_values_array get_counter_values_array(bool reset = false)
void reset_counter_value()

the following functions are not implemented by default, they will just throw

void finalize()

finalize() will be called just before the instance gets destructed

Private Types

typedef components::component_base<raw_values_counter> base_type

Private Members

hpx::util::function_nonser<std::vector<std::int64_t>bool)> hpx::performance_counters::server::raw_values_counter::f_
bool reset_
namespace hpx
namespace performance_counters
namespace server
template<typename Statistic>
class statistics_counter : public hpx::performance_counters::server::base_performance_counter, public components::component_base<statistics_counter<Statistic>>

Public Types

typedef statistics_counter type_holder
typedef base_performance_counter base_type_holder

Public Functions

statistics_counter()
statistics_counter(counter_info const &info, std::string const &base_counter_name, std::size_t parameter1, std::size_t parameter2, bool reset_base_counter)
hpx::performance_counters::counter_value get_counter_value(bool reset = false)

Overloads from the base_counter base class.

bool start()
bool stop()
void reset_counter_value()

the following functions are not implemented by default, they will just throw

void on_terminate()
void finalize()

finalize() will be called just before the instance gets destructed

Protected Functions

bool evaluate_base_counter(counter_value &value)
bool evaluate()
bool ensure_base_counter()

Private Types

typedef components::component_base<statistics_counter<Statistic>> base_type
typedef lcos::local::spinlock mutex_type

Private Functions

statistics_counter *this_()

Private Members

mutex_type mtx_
hpx::util::interval_timer timer_

base time interval in milliseconds

std::string base_counter_name_

name of base counter to be queried

naming::id_type base_counter_id_
std::unique_ptr<detail::counter_type_from_statistic_base> value_
counter_value prev_value_
bool has_prev_value_
std::size_t parameter1_
std::size_t parameter2_
bool reset_base_counter_