Lines Matching refs:stats
43 void _res_stats_clear_samples(res_stats* stats) { in _res_stats_clear_samples() argument
44 stats->sample_count = stats->sample_next = 0; in _res_stats_clear_samples()
48 void android_net_res_stats_aggregate(res_stats* stats, int* successes, int* errors, int* timeouts, in android_net_res_stats_aggregate() argument
57 for (int i = 0; i < stats->sample_count; ++i) { in android_net_res_stats_aggregate()
65 switch (stats->samples[i].rcode) { in android_net_res_stats_aggregate()
70 rtt_sum += stats->samples[i].rtt; in android_net_res_stats_aggregate()
98 if (stats->sample_count > 0) { in android_net_res_stats_aggregate()
99 if (stats->sample_next > 0) { in android_net_res_stats_aggregate()
100 last = stats->samples[stats->sample_next - 1].at; in android_net_res_stats_aggregate()
102 last = stats->samples[stats->sample_count - 1].at; in android_net_res_stats_aggregate()
111 static bool res_stats_usable_server(const res_params* params, res_stats* stats) { in res_stats_usable_server() argument
118 android_net_res_stats_aggregate(stats, &successes, &errors, &timeouts, &internal_errors, in res_stats_usable_server()
135 _res_stats_clear_samples(stats); in res_stats_usable_server()
146 int android_net_res_stats_get_usable_servers(const res_params* params, res_stats stats[], in android_net_res_stats_get_usable_servers() argument
150 bool usable = res_stats_usable_server(params, &stats[ns]); in android_net_res_stats_get_usable_servers()