Retrieve and optionally reset aggregated runtime statistics for all active database connections.
MCO_RET mco_stat_get_all(
/*OUT*/ mco_conn_statistics_t out_stats,
/*IN*/ int reset
);
out_stats
mco_stat_counter_value with size MCO_STATRT_TOTAL_COUNTERS. The function
writes the aggregated values of all registered counters into this array.reset
0 — only read the values (no reset),This function aggregates statistics from all active database connections. It sums the values of each counter (e.g., transaction counts, timing metrics) and stores the result in the provided output array.
If the
resetflag is non-zero, the function also clears the individual counters in every active connection after aggregation. This enables atomic “read-and-clear” behavior useful for periodic monitoring or delta-based reporting.The order of counters in the output array matches the registration order (including built-in counters like
MCO_STATRT_COMMIT_COUNT,MCO_STATRT_MAX_TRANS_TIME, etc.).Note: This function requires that at least one database with statistics support has been opened.
MCO_S_OK
MCO_E_NOINSTANCE