static uint64_t g_latencyStatSize;
static uint32_t g_disthashseed;
static unsigned int g_maxTCPPerClient;
-static unsigned int g_networkTimeoutMsec;
+unsigned int g_networkTimeoutMsec;
static unsigned int g_maxMThreads;
static unsigned int g_numDistributorThreads;
static unsigned int g_numWorkerThreads;
static string* pleaseGetCurrentQueries()
{
ostringstream ostr;
+ struct timeval now;
+ gettimeofday(&now, 0);
ostr << getMT()->d_waiters.size() <<" currently outstanding questions\n";
- boost::format fmt("%1% %|40t|%2% %|47t|%3% %|63t|%4% %|68t|%5%\n");
+ boost::format fmt("%1% %|40t|%2% %|47t|%3% %|63t|%4% %|68t|%5% %|78t|%6%\n");
- ostr << (fmt % "qname" % "qtype" % "remote" % "tcp" % "chained");
+ ostr << (fmt % "qname" % "qtype" % "remote" % "tcp" % "chained" % "spent(ms)");
unsigned int n=0;
for(const auto& mthread : getMT()->d_waiters) {
const PacketID& pident = mthread.key;
+ const double spent = g_networkTimeoutMsec - (DiffTime(now, mthread.ttd) * 1000);
ostr << (fmt
% pident.domain.toLogString() /* ?? */ % DNSRecordContent::NumberToType(pident.type)
% pident.remote.toString() % (pident.sock ? 'Y' : 'n')
% (pident.fd == -1 ? 'Y' : 'n')
+ % (spent > 0 ? spent : '0')
);
++n;
if (n >= 100)
string doTraceRegex(vector<string>::const_iterator begin, vector<string>::const_iterator end);
void parseACLs();
extern RecursorStats g_stats;
+extern unsigned int g_networkTimeoutMsec;
extern unsigned int g_numThreads;
extern uint16_t g_outgoingEDNSBufsize;
extern std::atomic<uint32_t> g_maxCacheEntries, g_maxPacketCacheEntries;