Changeset 1284
- Timestamp:
- 11/15/08 23:24:17 (16 months ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 7 modified
-
common_startup.cc (modified) (2 diffs)
-
dnsproxy.hh (modified) (1 diff)
-
packetcache.cc (modified) (10 diffs)
-
packetcache.hh (modified) (1 diff)
-
statbag.cc (modified) (5 diffs)
-
statbag.hh (modified) (2 diffs)
-
ueberbackend.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/common_startup.cc
r1281 r1284 182 182 void sendout(const DNSDistributor::AnswerData &AD) 183 183 { 184 static int &numanswered=*S.getPointer("udp-answers");185 static int &numanswered4=*S.getPointer("udp4-answers");186 static int &numanswered6=*S.getPointer("udp6-answers");184 static unsigned int &numanswered=*S.getPointer("udp-answers"); 185 static unsigned int &numanswered4=*S.getPointer("udp4-answers"); 186 static unsigned int &numanswered6=*S.getPointer("udp6-answers"); 187 187 188 188 if(!AD.A) … … 214 214 DNSPacket cached; 215 215 216 int &numreceived=*S.getPointer("udp-queries");217 int &numanswered=*S.getPointer("udp-answers");218 219 int &numreceived4=*S.getPointer("udp4-queries");220 int &numanswered4=*S.getPointer("udp4-answers");221 222 int &numreceived6=*S.getPointer("udp6-queries");223 int &numanswered6=*S.getPointer("udp6-answers");216 unsigned int &numreceived=*S.getPointer("udp-queries"); 217 unsigned int &numanswered=*S.getPointer("udp-answers"); 218 219 unsigned int &numreceived4=*S.getPointer("udp4-queries"); 220 unsigned int &numanswered4=*S.getPointer("udp4-answers"); 221 222 unsigned int &numreceived6=*S.getPointer("udp6-queries"); 223 unsigned int &numanswered6=*S.getPointer("udp6-answers"); 224 224 numreceived=-1; 225 225 int diff; -
trunk/pdns/pdns/dnsproxy.hh
r681 r1284 68 68 NetmaskGroup d_ng; 69 69 int d_sock; 70 int* d_resanswers;71 int* d_udpanswers;72 int* d_resquestions;70 unsigned int* d_resanswers; 71 unsigned int* d_udpanswers; 72 unsigned int* d_resquestions; 73 73 pthread_mutex_t d_lock; 74 74 uint16_t d_xor; -
trunk/pdns/pdns/packetcache.cc
r1228 r1284 38 38 S.declare("packetcache-size"); 39 39 40 statnumhit=S.getPointer("packetcache-hit");41 statnummiss=S.getPointer("packetcache-miss");42 statnumentries=S.getPointer("packetcache-size");40 d_statnumhit=S.getPointer("packetcache-hit"); 41 d_statnummiss=S.getPointer("packetcache-miss"); 42 d_statnumentries=S.getPointer("packetcache-size"); 43 43 } 44 44 … … 55 55 if(d_doRecursion && p->d.rd) { // wants recursion 56 56 if(!d_recursivettl) { 57 (* statnummiss)++;57 (*d_statnummiss)++; 58 58 d_miss++; 59 59 return 0; … … 62 62 else { // does not 63 63 if(!d_ttl) { 64 (* statnummiss)++;64 (*d_statnummiss)++; 65 65 d_miss++; 66 66 return 0; … … 81 81 82 82 if(!((d_hit+d_miss)%30000)) { 83 * statnumentries=d_map.size(); // needs lock83 *d_statnumentries=d_map.size(); // needs lock 84 84 } 85 85 string value; … … 87 87 if(getEntry(p->qdomain, p->qtype, PacketCache::PACKETCACHE, value, -1, packetMeritsRecursion)) { 88 88 // cerr<<"Packet cache hit!"<<endl; 89 (* statnumhit)++;89 (*d_statnumhit)++; 90 90 d_hit++; 91 91 if(cached->parse(value.c_str(), value.size()) < 0) { … … 97 97 } 98 98 // cerr<<"Packet cache miss"<<endl; 99 (* statnummiss)++;99 (*d_statnummiss)++; 100 100 d_miss++; 101 101 return 0; // bummer … … 164 164 delcount = d_map.size(); 165 165 d_map.clear(); 166 * statnumentries=0;166 *d_statnumentries=0; 167 167 return delcount; 168 168 } … … 239 239 } 240 240 } 241 * statnumentries=d_map.size();241 *d_statnumentries=d_map.size(); 242 242 return delcount; 243 243 } … … 283 283 WriteLock l(&d_mut); 284 284 285 * statnumentries=d_map.size();285 *d_statnumentries=d_map.size(); 286 286 287 287 unsigned int maxCached=::arg().asNum("max-cache-entries"); 288 288 unsigned int toTrim=0; 289 289 290 unsigned int cacheSize=* statnumentries;290 unsigned int cacheSize=*d_statnumentries; 291 291 292 292 if(maxCached && cacheSize > maxCached) { … … 325 325 } 326 326 // cerr<<"erased: "<<erased<<endl; 327 * statnumentries=d_map.size();327 *d_statnumentries=d_map.size(); 328 328 DLOG(L<<"Done with cache clean"<<endl); 329 329 } -
trunk/pdns/pdns/packetcache.hh
r1273 r1284 125 125 int d_recursivettl; 126 126 bool d_doRecursion; 127 int *statnumhit;128 int *statnummiss;129 int *statnumentries;127 unsigned int *d_statnumhit; 128 unsigned int *d_statnummiss; 129 unsigned int *d_statnumentries; 130 130 }; 131 131 -
trunk/pdns/pdns/statbag.cc
r681 r1284 52 52 ostringstream o; 53 53 lock(); 54 for(map<string, int *>::const_iterator i=d_stats.begin();54 for(map<string, unsigned int *>::const_iterator i=d_stats.begin(); 55 55 i!=d_stats.end(); 56 56 i++) … … 68 68 vector<string> ret; 69 69 lock(); 70 for(map<string, int *>::const_iterator i=d_stats.begin();70 for(map<string, unsigned int *>::const_iterator i=d_stats.begin(); 71 71 i!=d_stats.end(); 72 72 i++) … … 89 89 { 90 90 lock(); 91 int *i=newint(0);91 unsigned int *i=new unsigned int(0); 92 92 d_stats[key]=i; 93 93 d_keyDescrips[key]=descrip; … … 158 158 } 159 159 160 int *StatBag::getPointer(const string &key)160 unsigned int *StatBag::getPointer(const string &key) 161 161 { 162 162 exists(key); … … 166 166 StatBag::~StatBag() 167 167 { 168 for(map<string, int *>::const_iterator i=d_stats.begin();168 for(map<string,unsigned int *>::const_iterator i=d_stats.begin(); 169 169 i!=d_stats.end(); 170 170 i++) -
trunk/pdns/pdns/statbag.hh
r681 r1284 59 59 class StatBag 60 60 { 61 map<string, int *> d_stats;61 map<string, unsigned int *> d_stats; 62 62 map<string, string> d_keyDescrips; 63 63 map<string,StatRing>d_rings; … … 97 97 int read(const string &key); //!< read the value behind this key 98 98 int readZero(const string &key); //!< read the value behind this key, and zero it afterwards 99 int *getPointer(const string &key); //!< get a direct pointer to the value behind a key. Use this for high performance increments99 unsigned int *getPointer(const string &key); //!< get a direct pointer to the value behind a key. Use this for high performance increments 100 100 string getValueStr(const string &key); //!< read a value behind a key, and return it as a string 101 101 string getValueStrZero(const string &key); //!< read a value behind a key, and return it as a string, and zero afterwards -
trunk/pdns/pdns/ueberbackend.cc
r1218 r1284 238 238 { 239 239 extern PacketCache PC; 240 static int *qcachehit=S.getPointer("query-cache-hit");241 static int *qcachemiss=S.getPointer("query-cache-miss");240 static unsigned int *qcachehit=S.getPointer("query-cache-hit"); 241 static unsigned int *qcachemiss=S.getPointer("query-cache-miss"); 242 242 243 243 static int negqueryttl=::arg().asNum("negquery-cache-ttl");