Initialize a statistics histogram structure to its default state.
void mco_stat_histogram_init(
/*IN*/ mco_stat_histogram_h hist
);
hist
mco_stat_histogram_t structure to initialize.This function initializes a histogram structure by setting its range to the default value (
MCO_STAT_HISTOGRAM_DEFAULT_RANGE, typically 100) and clearing all histogram bins (bars) to zero.It must be called before using the histogram with
mco_stat_histogram_append()or storing it in the statistics subsystem. This function is also used internally to reset histograms when statistics are cleared via functions l ikemco_stat_get_conn_stats(..., reset = MCO_YES).
mco_stat_histogram_t my_hist;
// Initialize the histogram
mco_stat_histogram_init(&my_hist);
// Now it's safe to append values
mco_stat_histogram_append(&my_hist, 42);
mco_stat_histogram_append(&my_hist, 150);