|  | 
The HPX runtime system exposes a wide variety of predefined Performance Counters. These counters expose critical information about different modules of the runtime system. They can help determine system bottlenecks and fine-tune system and application performance.
Table 19. AGAS Performance Counters
| Counter Type | Counter Instance Formatting | Parameters | Description | 
|---|---|---|---|
| 
                     
                    where: | 
                     
                    where: | None | Returns the total number of invocations of the specified AGAS service since its creation. | 
| 
                     
                    where: | 
                     
                    where: | None | Returns the overall total number of invocations of all AGAS services provided by the given AGAS service category since its creation. | 
| 
                     
                    where: | 
                     
                    where: | None | Returns the overall execution time of the specified AGAS service since its creation (in nanoseconds). | 
| 
                     
                    where: | 
                     
                    where: | None | Returns the overall execution time of all AGAS services provided by the given AGAS service category since its creation (in nanoseconds). | 
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the number of cache events (evictions, hits, inserts,
                    and misses) in the AGAS cache of the specified locality (see
                     | 
Table 20. Parcel Layer Performance Counters
| Counter Type | Counter Instance Formatting | Parameters | Description | 
|---|---|---|---|
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the overall number of raw (uncompressed) bytes sent or
                    received (see  
                    The performance counters for the connection type  
                    The performance counters for the connection type  
                    The performance counters for the connection type  Please see CMake Variables used to configure HPX for more details. | 
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the total time (in nanoseconds) between the start of
                    each asynchronous transmission operation and the end of the corresponding
                    operation for the specified  
                    The performance counters for the connection type  
                    The performance counters for the connection type  
                    The performance counters for the connection type  Please see CMake Variables used to configure HPX for more details. | 
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the overall number of bytes transferred (see  
                    The performance counters for the connection type  
                    The performance counters for the connection type  
                    The performance counters for the connection type  Please see CMake Variables used to configure HPX for more details. | 
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the overall time spent performing outgoing data serialization
                    for the specified  
                    The performance counters for the connection type  
                    The performance counters for the connection type  
                    The performance counters for the connection type  Please see CMake Variables used to configure HPX for more details. | 
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the overall time spent performing outgoing security operations
                    for the specified  
                    The performance counters for the connection type  
                    The performance counters for the connection type  
                    The performance counters for the connection type  
                    These performance counters are available only if the compile
                    time constant  Please see CMake Variables used to configure HPX for more details. | 
| 
                     | 
                     
                    where: | None | Returns the overall number of routed (outbound) parcels transferred by the given locality. Routed parcels are those which cannot directly be delivered to its destination as the local AGAS is not able to resolve the destination address. In this case a parcel is sent to the AGAS service component which is responsible for creating the destination GID (and is responsible for resolving the destination address). This AGAS service component will deliver the parcel to its final target. | 
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the overall number of parcels transferred using the specified
                     
                    The performance counters for the connection type  
                    The performance counters for the connection type  
                    The performance counters for the connection type  Please see CMake Variables used to configure HPX for more details. | 
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the overall number of messages [a] transferred using the specified  
                    The performance counters for the connection type  
                    The performance counters for the connection type  
                    The performance counters for the connection type  Please see CMake Variables used to configure HPX for more details. | 
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the overall number cache events (evictions, hits, inserts,
                    misses, and reclaims) for the connection cache of the given connection
                    type on the given locality (see  
                    The performance counters for the connection type  
                    The performance counters for the connection type  
                    The performance counters for the connection type  Please see CMake Variables used to configure HPX for more details. | 
| 
                     
                    where: | 
                     
                    where: | None | 
                    Returns the current number of parcels stored in the parcel queue
                    (see  | 
| [a] A message can potentially consist of more than one parcel. | |||
Table 21. Thread Manager Performance Counters
| Counter Type | Counter Instance Formatting | Parameters | Description | 
|---|---|---|---|
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the overall number of executed (retired) HPX-threads
                    on the given locality since application start. If the instance
                    name is  | 
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the overall number of executed HPX-thread
                    phases (invocations) on the given locality since application
                    start. If the instance name is  | 
| 
                     
                    where: | 
                     
                    where: 
                     
                    The  | None | 
                    Returns the current number of HPX-threads
                    having the given thread state on the given locality. If the instance
                    name is  | 
| 
                     
                    where: | 
                     
                    where: 
                     
                    The  | None | 
                    Returns the average wait time of HPX-threads
                    (if the thread state is  
                    These counters are available only if the compile time constant
                     | 
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the average idle rate for the given worker thread(s)
                    on the given locality. The idle rate is defined as the ratio
                    of the time spent on scheduling and management tasks and the
                    overall time spent executing work since the application started.
                    This counter is available only if the configuration time constant
                     | 
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the average idle rate for the given worker thread(s)
                    on the given locality which is caused by creating new threads.
                    The creation idle rate is defined as the ratio of the time spent
                    on creating new threads and the overall time spent executing
                    work since the application started. This counter is available
                    only if the configuration time constants  | 
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the average idle rate for the given worker thread(s)
                    on the given locality which is caused by cleaning up terminated
                    threads. The cleanup idle rate is defined as the ratio of the
                    time spent on cleaning up terminated thread objects and the overall
                    time spent executing work since the application started. This
                    counter is available only if the configuration time constants
                     | 
| 
                     | 
                     
                    where: 
                     | None | Returns the overall length of all queues for the given worker thread(s) on the given locality. | 
| 
                     | 
                     
                    where: | None | Returns the total number of HPX-thread unbind (madvise) operations performed for the referenced locality. Note that this counter is not available on Windows based platforms. | 
| 
                     | 
                     
                    where: | None | Returns the total number of HPX-thread recycling operations performed. | 
| 
                     | 
                     
                    where: | None | 
                    Returns the total number of HPX-threads
                    'stolen' from the pending thread queue by a neighboring thread
                    worker thread (these threads are executed by a different worker
                    thread than they were initially scheduled on). This counter is
                    available only if the configuration time constant  | 
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the total number of times that the referenced worker-thread
                    on the referenced locality failed to find pending HPX-threads
                    in its associated queue. This counter is available only if the
                    configuration time constant  | 
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the total number of times that the referenced worker-thread
                    on the referenced locality looked for pending HPX-threads in
                    its associated queue. This counter is available only if the configuration
                    time constant  | 
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the total number of HPX-threads
                    'stolen' from the staged thread queue by a neighboring worker
                    thread (these threads are executed by a different worker thread
                    than they were initially scheduled on). This counter is available
                    only if the configuration time constant  | 
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the total number of HPX-threads
                    'stolen' from the pending thread queue of a neighboring worker
                    thread (these threads are executed by a different worker thread
                    than they were initially scheduled on). This counter is available
                    only if the configuration time constant  | 
| 
                     | 
                     
                    where: 
                     | None | 
                    Returns the total number of HPX-threads
                    'stolen' from the staged thread queue of a neighboring worker
                    thread (these threads are executed by a different worker thread
                    than they were initially scheduled on). This counter is available
                    only if the configuration time constant  | 
| 
                     | 
                     
                    where: 
                     | None | Returns the total number of HPX-thread objects created. Note that thread objects are reused to improve system performance, thus this number does not reflect the number of actually executed (retired) HPX-threads. | 
Table 22. Performance Counters related to LCOs
| Counter Type | Counter Instance Formatting | Parameters | Description | 
|---|---|---|---|
| 
                     
                    where: | 
                     
                    where: | None | Returns the overall number of operations performed on full-empty bit data structures on the specified locality. | 
| 
                     
                    where: | 
                     
                    where: | None | Returns the overall number of operations performed on dataflow components on the specified locality. | 
Table 23. General Performance Counters exposing Characteristics of Localities
| Counter Type | Counter Instance Formatting | Parameters | Description | 
|---|---|---|---|
| 
                     | 
                     
                    where: | 
                    The type of the component. This is the string which has been
                    used while registering the component with HPX,
                    e.g. which has been passed as the second parameter to the macro
                     | Returns the overall number of currently active components of the specified type on the given locality. | 
| 
                     | 
                     
                    where: | None | Returns the overall time since application start on the given locality in nanoseconds. | 
| 
                     | 
                     
                    where: | None | Returns the amount of virtual memory currently allocated by the referenced locality (in bytes). | 
| 
                     | 
                     
                    where: | None | Returns the amount of resident memory currently allocated by the referenced locality (in bytes). | 
Table 24. Performance Counters for General Statistics
| Counter Type | Counter Instance Formatting | Parameters | Description | 
|---|---|---|---|
| 
                     | Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. | Returns the current average (mean) value calculated based on the values queried from the underlying counter (the one specified as the instance name). | 
                    Any parameter will be interpreted as the time interval (in milliseconds)
                    at which the underlying counter should be queried. If no value
                    is specified, the counter will assume  | 
| 
                     | Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. | Returns the current standard deviation (stddev) value calculated based on the values queried from the underlying counter (the one specified as the instance name). | 
                    Any parameter will be interpreted as the time interval (in milliseconds)
                    at which the underlying counter should be queried. If no value
                    is specified, the counter will assume  | 
| 
                     | Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. | Returns the current rolling average (mean) value calculated based on the values queried from the underlying counter (the one specified as the instance name). | 
                    Any parameter will be interpreted as a list of two comma separated
                    (integer) values, where the first is the time interval (in milliseconds)
                    at which the underlying counter should be queried. If no value
                    is specified, the counter will assume  | 
| 
                     | Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. | Returns the current (statistically estimated) median value calculated based on the values queried from the underlying counter (the one specified as the instance name). | 
                    Any parameter will be interpreted as the time interval (in milliseconds)
                    at which the underlying counter should be queried. If no value
                    is specified, the counter will assume  | 
| 
                     | Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. | Returns the current maximum value calculated based on the values queried from the underlying counter (the one specified as the instance name). | 
                    Any parameter will be interpreted as the time interval (in milliseconds)
                    at which the underlying counter should be queried. If no value
                    is specified, the counter will assume  | 
| 
                     | Any full performance counter name. The referenced performance counter is queried at fixed time intervals as specified by the first parameter. | Returns the current minimum value calculated based on the values queried from the underlying counter (the one specified as the instance name). | 
                    Any parameter will be interpreted as the time interval (in milliseconds)
                    at which the underlying counter should be queried. If no value
                    is specified, the counter will assume  | 
Table 25. Performance Counters for Elementary Arithmetic Operations
| Counter Type | Counter Instance Formatting | Parameters | Description | 
|---|---|---|---|
| 
                     | None | Returns the sum calculated based on the values queried from the underlying counters (the ones specified as the parameters). | The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. | 
| 
                     | None | Returns the difference calculated based on the values queried from the underlying counters (the ones specified as the parameters). | The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. | 
| 
                     | None | Returns the product calculated based on the values queried from the underlying counters (the ones specified as the parameters). | The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. | 
| 
                     | None | Returns the result of division of the values queried from the underlying counters (the ones specified as the parameters). | The parameter will be interpreted as a comma separated list of full performance counter names which are queried whenever this counter is accessed. Any wildcards in the counter names will be expanded. | 
| ![[Note]](../../../images/note.png) | Note | 
|---|---|
| 
            The /arithmetics counters can consume an arbitrary number of other counters.
            For this reason those have to be specified as parameters (a comma separated
            list of counters appended after a  ./bin/hello_world -t2 \
    --hpx:print-counter=/threads{locality#0/worker-thread#*}/count/cumulative \
    --hpx:print-counter=/arithmetics/add@/threads{locality#0/worker-thread#*}/count/cumulative
hello world from OS-thread 0 on locality 0
hello world from OS-thread 1 on locality 0
/threads{locality#0/worker-thread#0}/count/cumulative,1,0.515640,[s],25
/threads{locality#0/worker-thread#1}/count/cumulative,1,0.515520,[s],36
/arithmetics/add@/threads{locality#0/worker-thread#*}/count/cumulative,1,0.516445,[s],64
            Since all wildcards in the parameters are expanded, this example is fully
            equivalent to specifying both counters separately to  ./bin/hello_world -t2 \
    --hpx:print-counter=/threads{locality#0/worker-thread#*}/count/cumulative \
    --hpx:print-counter=/arithmetics/add@\
        /threads{locality#0/worker-thread#0}/count/cumulative,\
        /threads{locality#0/worker-thread#1}/count/cumulative
 |