Retrieve the current value of a registered runtime statistics counter.
MCO_RET mco_stat_counter_get(
/*IN*/ mco_stat_hdl counter,
/*OUT*/ mco_stat_counter_value *ret_value
);
counter
0 to MCO_STATRT_TOTAL_COUNTERS - 1
or those returned by mco_statrt_register_counter().ret_value
This function returns the current value of the specified runtime statistics counter. Counters track various database metrics such as transaction counts, error rates, timing data, and other performance indicators.
The counter must have been previously registered via
mco_statrt_register_counter()(for custom counters) or be one of the built-in counters (e.g.,MCO_STATRT_COMMIT_COUNT,MCO_STATRT_MAX_TRANS_TIME).The value is aggregated across all active database connections. This function does not reset the counter — use
mco_stat_get_conn_stats()with theresetflag if you need atomic read-and-clear behavior.Note: The statistics subsystem must be initialized (i.e., a database with statistics support must be open) before calling this function.
MCO_S_OK
MCO_E_INVALID_HANDLE