Changeset 1750
- Timestamp:
- 12/14/10 14:35:44 (2 years ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 4 modified
-
docs/pdns.sgml (modified) (2 diffs)
-
rec_channel_rec.cc (modified) (10 diffs)
-
recpacketcache.cc (modified) (2 diffs)
-
recpacketcache.hh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/docs/pdns.sgml
r1728 r1750 9808 9808 answers1-10 counts the number of queries answered within 10 miliseconds 9809 9809 answers-slow counts the number of queries answered after 1 second 9810 cache-bytes Size of the cache in bytes (since 3.3.1) 9810 9811 cache-entries shows the number of entries in the cache 9811 9812 cache-hits counts the number of cache hits since starting … … 9824 9825 outgoing-timeouts counts the number of timeouts on outgoing UDP queries since starting 9825 9826 over-capacity-drops Questions dropped because over maximum concurrent query limit (since 3.2) 9827 packetcache-bytes Size of the packet cache in bytes (since 3.3.1) 9826 9828 packetcache-entries Size of packet cache (since 3.2) 9827 9829 packetcache-hits Packet cache hits (since 3.2) -
trunk/pdns/pdns/rec_channel_rec.cc
r1745 r1750 299 299 } 300 300 301 uint64_t* pleaseGetCacheBytes() 302 { 303 return new uint64_t(t_RC->bytes()); 304 } 305 306 301 307 uint64_t doGetCacheSize() 302 308 { … … 304 310 } 305 311 312 uint64_t doGetCacheBytes() 313 { 314 return broadcastAccFunction<uint64_t>(pleaseGetCacheBytes); 315 } 316 306 317 uint64_t* pleaseGetCacheHits() 307 318 { … … 325 336 326 337 327 328 329 338 uint64_t* pleaseGetPacketCacheSize() 330 339 { … … 332 341 } 333 342 343 uint64_t* pleaseGetPacketCacheBytes() 344 { 345 return new uint64_t(t_packetCache->bytes()); 346 } 347 348 334 349 uint64_t doGetPacketCacheSize() 335 350 { … … 337 352 } 338 353 354 uint64_t doGetPacketCacheBytes() 355 { 356 return broadcastAccFunction<uint64_t>(pleaseGetPacketCacheBytes); 357 } 358 359 339 360 uint64_t* pleaseGetPacketCacheHits() 340 361 { … … 357 378 } 358 379 380 uint64_t doGetMallocated() 381 { 382 // this turned out to be broken 383 /* struct mallinfo mi = mallinfo(); 384 return mi.uordblks; */ 385 return 0; 386 } 359 387 360 388 RecursorControlParser::RecursorControlParser() … … 366 394 addGetStat("cache-misses", doGetCacheMisses); 367 395 addGetStat("cache-entries", doGetCacheSize); 396 addGetStat("cache-bytes", doGetCacheBytes); 368 397 369 398 addGetStat("packetcache-hits", doGetPacketCacheHits); 370 399 addGetStat("packetcache-misses", doGetPacketCacheMisses); 371 400 addGetStat("packetcache-entries", doGetPacketCacheSize); 372 373 401 addGetStat("packetcache-bytes", doGetPacketCacheBytes); 402 403 addGetStat("malloc-bytes", doGetMallocated); 374 404 375 405 addGetStat("servfail-answers", &g_stats.servFails); … … 457 487 static void doExitNicely() 458 488 { 489 //extern void printCallers(); 490 // printCallers(); 459 491 doExitGeneric(true); 460 492 } … … 531 563 *command=&doExitNicely; 532 564 return "bye nicely\n"; 533 } 534 565 } 535 566 536 567 if(cmd=="dump-cache") … … 578 609 return reloadAuthAndForwards(); 579 610 } 580 611 581 612 return "Unknown command '"+cmd+"'\n"; 582 613 } -
trunk/pdns/pdns/recpacketcache.cc
r1705 r1750 1 1 #include <iostream> 2 #include <boost/foreach.hpp> 2 3 #include "recpacketcache.hh" 3 4 #include "cachecleaner.hh" … … 63 64 } 64 65 66 uint64_t RecursorPacketCache::bytes() 67 { 68 uint64_t sum=0; 69 BOOST_FOREACH(const struct Entry& e, d_packetCache) { 70 sum += sizeof(e) + e.d_packet.length() + 4; 71 } 72 return sum; 73 } 74 75 65 76 void RecursorPacketCache::doPruneTo(unsigned int maxCached) 66 77 { -
trunk/pdns/pdns/recpacketcache.hh
r1702 r1750 27 27 uint64_t d_hits, d_misses; 28 28 uint64_t size(); 29 uint64_t bytes(); 29 30 30 31 private: