Lines Matching refs:quantiles
206 int stats_quantiles_init(stats_quantiles_t * quantiles, int nines) in stats_quantiles_init() argument
211 quantiles->nines = nines; in stats_quantiles_init()
213 quantiles->quantiles = calloc(sizeof(long), (nines - 1)); in stats_quantiles_init()
214 if (!quantiles->quantiles) { in stats_quantiles_init()
220 int stats_quantiles_free(stats_quantiles_t * quantiles) in stats_quantiles_free() argument
222 free(quantiles->quantiles); in stats_quantiles_free()
227 stats_quantiles_t * quantiles) in stats_quantiles_calc() argument
235 (data->index + 1) < (long)exp10(quantiles->nines)) { in stats_quantiles_calc()
242 for (i = 2; i <= quantiles->nines; i++) { in stats_quantiles_calc()
244 quantiles->quantiles[i - 2] = data->records[index].y; in stats_quantiles_calc()
249 void stats_quantiles_print(stats_quantiles_t * quantiles) in stats_quantiles_print() argument
253 for (i = 0; i <= quantiles->nines - 2; i++) { in stats_quantiles_print()
256 printf("99.%d%% < %ld\n", fraction, quantiles->quantiles[i]); in stats_quantiles_print()