]> granicus.if.org Git - pdns/commitdiff
oops, need to limit top-remotes
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 18 Apr 2006 22:51:24 +0000 (22:51 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 18 Apr 2006 22:51:24 +0000 (22:51 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@733 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/rec_channel_rec.cc

index 5f585244cb879191496e29c5a498520ce7dbde76..57b37a4f187b7bf1aadd88a2d6b37cfc6e0ab980 100644 (file)
@@ -203,8 +203,9 @@ string doTopRemotes()
   ostringstream ret;
   ret<<"Over last "<<total<<" queries:\n";
   format fmt("%.02f%%\t%s\n");
+  int limit=0;
   if(total)
-    for(rcounts_t::const_iterator i=rcounts.begin(); i != rcounts.end(); ++i)
+    for(rcounts_t::const_iterator i=rcounts.begin(); i != rcounts.end() && limit < 20; ++i, ++limit)
       ret<< fmt % (-100.0*i->first/total) % i->second.toString();
 
   return ret.str();