commit | 356e4c60bc6dd3a318a54911b81a2654a1c39a02 | [log] [tgz] |
---|---|---|
author | waynema <waynema@google.com> | Mon Sep 13 16:28:12 2021 +0800 |
committer | waynema <waynema@google.com> | Tue Sep 28 14:28:02 2021 +0800 |
tree | 963b125ec6fecb77fce57357265b1d683fa3063c | |
parent | 67936ef2be46a6942f302964f31cff5c237f6941 [diff] |
DoH statistics is now available from DnsStats and is shown in dumpsys dnsresolver. Example of output from dumpsys dnsresolver: Server statistics: (total, RTT avg, {rcode:counts}, last update) over UDP 8.8.4.4 (3, 2503ms, [TIMEOUT:3 ], 465s) score{71.0} 8.8.8.8 (4, 1880ms, [NOERROR:1 TIMEOUT:3 ], 468s) score{77.3} 2001:4860:4860::8844 (9, 15ms, [NOERROR:9 ], 78s) score{99.8} 2001:4860:4860::8888 <no data> score{100.0} over DOH 2001:4860:4860::8888 (89, 30ms, [NOERROR:89 ], 127s) score{99.7} over TLS 8.8.4.4 <no data> score{100.0} 8.8.8.8 <no data> score{100.0} 2001:4860:4860::8844 <no data> score{100.0} 2001:4860:4860::8888 <no data> score{100.0} over TCP 8.8.4.4 <no data> score{100.0} 8.8.8.8 <no data> score{100.0} 2001:4860:4860::8844 <no data> score{100.0} 2001:4860:4860::8888 <no data> score{100.0} over MDNS 224.0.0.251 <no data> score{100.0} ff02::fb <no data> score{100.0} TC mode: default TransportType: WIFI Test steps: a. Default enable strict mode. b. Turn on WiFi. c. Turn on Mobile data. d. Check the output from dumpsys dnsresolver. e. Expect to see two different statistics with the same DNS server on different NetId. NetId: 101 over DOH 2001:4860:4860::8888 (90, 29ms, [NOERROR:90 ], 7s) score{99.7} TransportType: WIFI NetId: 102 over DOH 2001:4860:4860::8888 (2, 33ms, [NOERROR:2 ], 74s) score{99.7} TransportType: CELLULAR Bug: 195092631 Test: checked output in dumpsys dnsresolver Change-Id: I65c69a850bce352839314833d44c9f165c7ca142
This code uses LOG(X) for logging. Log levels are VERBOSE,DEBUG,INFO,WARNING and ERROR. The default setting is WARNING and logs relate to WARNING and ERROR will be shown. If you want to enable the DEBUG level logs, using following command. adb shell service call dnsresolver 10 i32 1 VERBOSE 0 DEBUG 1 INFO 2 WARNING 3 ERROR 4 Verbose resolver logs could contain PII -- do NOT enable in production builds.