6 Statistics Functions

This chapter describes functions used to retrieve and examine statistical information. There are two types of statistics described here: statistics related to store operations and state, and statistics related to parallel scan operations.

For store-related statistics, metrics can be obtained on a per-node or per-operation basis. All statistical information is contained within a structure that you allocate using kv_get_stats(). You release the resources allocated for this structure using kv_release_stats().

In many cases, statistical information is reported for a time interval. For example, this happens when information is retrieved that reports on maximum, minimum and average numbers. In this case, the reporting interval can be restarted by calling kv_get_stats() with a value of 1 for the clear parameter.

For parallel scan statistics, the statistics are retrieved from a parallel scan iterator using either kv_parallel_scan_get_partition_metrics() or kv_parallel_scan_get_shard_metrics(). This returns a structure that you can examine using a number of different functions. You release this structure using kv_release_detailed_metrics_list().

Statistics Functions

Statistics Functions Description
kv_get_node_metrics()

Returns metrics associated with each node in the KV Store

kv_get_num_nodes()

Return the number of nodes contained in the KV Store

kv_get_num_operations()

Return the number of operations that were executed

kv_get_operation_metrics()

Aggregates the metrics associated with a KV Store operation

kv_get_stats()

Return statistics associated with the KV Store

kv_release_stats()

Release the statistics structure

kv_stats_string()

Returns a descriptive string containing metrics for each operation

Parallel Scan Statistics Functions

Parallel Scan Statistics Functions Description
kv_detailed_metrics_list_size()

Returns the size of the detailed metrics list

kv_detailed_metrics_list_get_record_count()

Returns the number of records in the detailed metrics list

kv_detailed_metrics_list_get_scan_time()

Returns the time used to perform the parallel scan

kv_detailed_metrics_list_get_name()

Returns the name of the shard or partition used by the parallel scan

kv_parallel_scan_get_partition_metrics()

Returns parallel scan metrics for the partition

kv_parallel_scan_get_shard_metrics()

Returns parallel scan metrics for the partition

kv_release_detailed_metrics_list()

Releases the detailed metrics list