Show
Ignore:
Timestamp:
12/21/06 10:06:46 (6 years ago)
Author:
ahu
Message:

some more stats

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/recursor_cache.cc

    r931 r934  
    55#include "dnsrecords.hh" 
    66#include "arguments.hh" 
     7#include "syncres.hh" 
    78 
    89using namespace std; 
     
    146147{ 
    147148  if(!d_cachecachevalid || Utility::strcasecmp(d_cachedqname.c_str(), qname)) { 
    148     cerr<<"had cache cache miss for '"<<qname<<"'"<<endl; 
     149//    cerr<<"had cache cache miss for '"<<qname<<"'"<<endl; 
    149150    d_cachedqname=qname; 
    150151    d_cachecache=d_cache.equal_range(tie(qname)); 
     
    155156  //    cerr<<"had cache cache hit!"<<endl; 
    156157 
    157   if(d_cachecache.first == d_cachecache.second) 
     158  if(d_cachecache.first == d_cachecache.second) { 
     159    g_stats.noShuntNoMatch++; 
    158160    return false; 
     161  } 
    159162 
    160163  pair<cache_t::iterator, cache_t::iterator> range = d_cachecache; 
     
    162165  unsigned int n=0; 
    163166  for(;range.first != range.second; ++range.first) { 
    164     if(range.first->d_qtype == QType::CNAME) // if we see a cname, we need the whole shebang (for now) 
     167    if(range.first->d_qtype == QType::CNAME) { // if we see a cname, we need the whole shebang (for now) 
     168      g_stats.noShuntCNAME++; 
    165169      return false; 
     170    } 
    166171    if(range.first->d_qtype != qt.getCode()) 
    167172      continue; 
    168     if(range.first->getTTD() < (unsigned int) now) 
     173    if(range.first->getTTD() < (unsigned int) now) { 
     174      g_stats.noShuntExpired++; 
    169175      return false; 
     176    } 
    170177     
    171     if(range.first->d_records.empty() || range.first->d_records.size() > 9 ) 
     178    if(range.first->d_records.empty() || range.first->d_records.size() > 9 ) { 
     179      g_stats.noShuntSize++; 
    172180      return false; 
     181    } 
    173182     
    174183    size_t limit=range.first->d_records.size(); 
     
    190199      return false; 
    191200  } 
     201  if(!n) 
     202    g_stats.noShuntNoMatch++; 
    192203  return n; 
    193204