Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e02d01c1 authored by lifr's avatar lifr Committed by Frank Li
Browse files

Fill in DNS query type in DNS metric when DNS lookup hit cache

- When looking up DNS in cache, Rasta and DNS statistics are required
  Perform statistical analysis based on the type of DNS query.

The DNS stats proto shows "query type" as following:
============================================================
Without the commit:
        dns_query_events {
          dns_query_event {
            cache_hit: CS_FOUND
            latency_micros: 12
          }
With the commit:
        dns_query_events {
          dns_query_event {
            type: NS_T_AAAA <= ”DNS query type”
            cache_hit: CS_FOUND
            latency_micros: 12
          }


Bug: 147031435
Test: statsd_testdrive
Change-Id: Iac6a6f819104247ecec65bb4134a33ddd66cfa9c
parent b9da5e9a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -418,6 +418,7 @@ int res_nsend(res_state statp, const uint8_t* buf, int buflen, uint8_t* ans, int
        DnsQueryEvent* dnsQueryEvent = addDnsQueryEvent(statp->event);
        dnsQueryEvent->set_latency_micros(cacheLatencyUs);
        dnsQueryEvent->set_cache_hit(static_cast<CacheStatus>(cache_status));
        dnsQueryEvent->set_type(getQueryType(buf, buflen));
        return anslen;
    } else if (cache_status != RESOLV_CACHE_UNSUPPORTED) {
        // had a cache miss for a known network, so populate the thread private