Lines Matching full:metrics
53 * of roll-overs we can still maintain recent metrics for calculations:
182 /* Copy metrics to prev and clear */ in ares_metrics_record()
183 if (ts != server->metrics[i].ts) { in ares_metrics_record()
184 server->metrics[i].prev_ts = server->metrics[i].ts; in ares_metrics_record()
185 server->metrics[i].prev_total_ms = server->metrics[i].total_ms; in ares_metrics_record()
186 server->metrics[i].prev_total_count = server->metrics[i].total_count; in ares_metrics_record()
187 server->metrics[i].ts = ts; in ares_metrics_record()
188 server->metrics[i].latency_min_ms = 0; in ares_metrics_record()
189 server->metrics[i].latency_max_ms = 0; in ares_metrics_record()
190 server->metrics[i].total_ms = 0; in ares_metrics_record()
191 server->metrics[i].total_count = 0; in ares_metrics_record()
194 if (server->metrics[i].latency_min_ms == 0 || in ares_metrics_record()
195 server->metrics[i].latency_min_ms > query_ms) { in ares_metrics_record()
196 server->metrics[i].latency_min_ms = query_ms; in ares_metrics_record()
199 if (query_ms > server->metrics[i].latency_max_ms) { in ares_metrics_record()
200 server->metrics[i].latency_max_ms = query_ms; in ares_metrics_record()
203 server->metrics[i].total_count++; in ares_metrics_record()
204 server->metrics[i].total_ms += (ares_uint64_t)query_ms; in ares_metrics_record()
221 if (ts != server->metrics[i].ts || in ares_metrics_server_timeout()
222 server->metrics[i].total_count < MIN_COUNT_FOR_AVERAGE) { in ares_metrics_server_timeout()
224 if (prev_ts != server->metrics[i].prev_ts || in ares_metrics_server_timeout()
225 server->metrics[i].prev_total_count < MIN_COUNT_FOR_AVERAGE) { in ares_metrics_server_timeout()
230 timeout_ms = (size_t)(server->metrics[i].prev_total_ms / in ares_metrics_server_timeout()
231 server->metrics[i].prev_total_count); in ares_metrics_server_timeout()
235 (size_t)(server->metrics[i].total_ms / server->metrics[i].total_count); in ares_metrics_server_timeout()