From: Bert Hubert Date: Thu, 16 Sep 2010 20:02:02 +0000 (+0000) Subject: add delivery time statistics to inflighter X-Git-Tag: rec-3.3~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ed022a7fc7c65a7213a091f0c20b5b24dfc76f6;p=pdns add delivery time statistics to inflighter git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1717 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/inflighter.cc b/pdns/inflighter.cc index e53797988..486210792 100644 --- a/pdns/inflighter.cc +++ b/pdns/inflighter.cc @@ -52,7 +52,7 @@ private: { typename Container::iterator iter; typename SenderReceiver::Identifier id; - struct timeval ttd; + struct timeval sentTime, ttd; }; typedef multi_index_container< @@ -91,7 +91,8 @@ template bool Inflighter bool Inflighteriter, answer); // deliver to sender/receiver + struct timeval now; + gettimeofday(&now, 0); + unsigned int usec = 1000000*(now.tv_sec - ival->sentTime.tv_sec) + (now.tv_usec - ival->sentTime.tv_usec); + d_sr.deliverAnswer(*ival->iter, answer, usec); // deliver to sender/receiver d_ttdWatch.erase(ival); break; // we can send new questions! } diff --git a/pdns/slavecommunicator.cc b/pdns/slavecommunicator.cc index 60b100ef0..b095f887e 100644 --- a/pdns/slavecommunicator.cc +++ b/pdns/slavecommunicator.cc @@ -150,7 +150,7 @@ struct SlaveSenderReceiver return 0; } - void deliverAnswer(DomainInfo& i, uint32_t serial) + void deliverAnswer(DomainInfo& i, uint32_t serial, uint32_t usec) { d_serials[i.id]=serial; }