struct __res_sample {
time_t at; // time in s at which the sample was recorded
uint16_t rtt; // round-trip time in ms
uint8_t rcode; // the DNS rcode or RCODE_XXX defined above
};
struct __res_stats { // Stats of the last <sample_count> queries. struct __res_sample samples[MAXNSSAMPLES]; // The number of samples stored.
uint8_t sample_count; // The next sample to modify.
uint8_t sample_next;
};
/* Calculate the round-trip-time from start time t0 and end time t1. */ externint
_res_stats_calculate_rtt(conststruct timespec* t1, conststruct timespec* t0);
/* Initialize a sample for calculating server reachability statistics. */ externvoid
_res_stats_set_sample(struct __res_sample* sample, time_t now, int rcode, int rtt);
/* Returns true if the server is considered unusable, i.e. if the success rate is not lower than the *thresholdforthestoredstoredsamples.Ifnotenoughsamplesarestored,theserveris *consideredusable.
*/ externbool
_res_stats_usable_server(conststruct __res_params* params, struct __res_stats* stats);
__BEGIN_DECLS /* Aggregates the reachability statistics for the given server based on on the stored samples. */ externvoid
android_net_res_stats_aggregate(struct __res_stats* stats, int* successes, int* errors, int* timeouts, int* internal_errors, int* rtt_avg, time_t* last_sample_time)
__attribute__((visibility ("default")));
/* Returns an array of bools indicating which servers are considered good */ externvoid
android_net_res_stats_get_usable_servers(conststruct __res_params* params, struct __res_stats stats[], int nscount, bool valid_servers[])
__attribute__((visibility ("default")));
__END_DECLS
#endif// _RES_STATS_H
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.