}
#endif
handler.writeSizeAndMsg(query, dq.len, g_tcpSendTimeout);
- g_stats.selfAnswered++;
- continue;
- }
+ g_stats.selfAnswered++;
+ doLatencyStats(0); // we're not going to measure this
+ continue;
+ }
std::shared_ptr<ServerPool> serverPool = getPool(*holders.pools, poolname);
std::shared_ptr<DNSDistPacketCache> packetCache = nullptr;
}
#endif
handler.writeSizeAndMsg(cachedResponse, cachedResponseSize, g_tcpSendTimeout);
+ doLatencyStats(0); // we're not going to measure this
g_stats.cacheHits++;
continue;
}
}
#endif
handler.writeSizeAndMsg(query, dq.len, g_tcpSendTimeout);
+
+ // no response-only statistics counter to update.
+ doLatencyStats(0); // we're not going to measure this
continue;
}
std::lock_guard<std::mutex> lock(g_rings.respMutex);
g_rings.respRing.push_back({answertime, ci.remote, qname, dq.qtype, (unsigned int)udiff, (unsigned int)responseLen, *dh, ds->remote});
}
+ doLatencyStats(udiff);
rewrittenResponse.clear();
}
DelayPipe<DelayedPacket> * g_delay = 0;
-static void doLatencyStats(double udiff)
+void doLatencyStats(double udiff)
{
if(udiff < 1000) g_stats.latency0_1++;
else if(udiff < 10000) g_stats.latency1_10++;