Changeset 1512 for trunk/pdns/pdns/pdns_recursor.cc
- Timestamp:
- 02/08/10 20:07:25 (3 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/pdns_recursor.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/pdns_recursor.cc
r1511 r1512 831 831 if(response.length() >= sizeof(struct dnsheader)) 832 832 updateRcodeStats(((struct dnsheader*)response.c_str())->rcode); 833 g_stats.avgLatencyUsec=(uint64_t)((1-0.0001)*g_stats.avgLatencyUsec + 0); // we assume 0 usec 833 834 return; 834 835 } … … 1057 1058 { 1058 1059 static __thread time_t last_stat, last_rootupdate, last_prune; 1060 static __thread int cleanCounter=0; 1059 1061 struct timeval now; 1060 1062 Utility::gettimeofday(&now, 0); … … 1071 1073 negcache_by_ttd_index_t::iterator i=ttdindex.lower_bound(now.tv_sec); 1072 1074 ttdindex.erase(ttdindex.begin(), i); 1073 1074 time_t limit=now.tv_sec-300; 1075 for(SyncRes::nsspeeds_t::iterator i = SyncRes::t_sstorage->nsSpeeds.begin() ; i!= SyncRes::t_sstorage->nsSpeeds.end(); ) 1076 if(i->second.stale(limit)) 1077 SyncRes::t_sstorage->nsSpeeds.erase(i++); 1078 else 1079 ++i; 1075 1076 if(!((cleanCounter++)%40)) { // this is a full scan! 1077 time_t limit=now.tv_sec-300; 1078 for(SyncRes::nsspeeds_t::iterator i = SyncRes::t_sstorage->nsSpeeds.begin() ; i!= SyncRes::t_sstorage->nsSpeeds.end(); ) 1079 if(i->second.stale(limit)) 1080 SyncRes::t_sstorage->nsSpeeds.erase(i++); 1081 else 1082 ++i; 1083 } 1080 1084 // L<<Logger::Warning<<"Spent "<<dt.udiff()/1000<<" msec cleaning"<<endl; 1081 1085 last_prune=time(0);