From: bert hubert Date: Thu, 11 Dec 2014 11:18:13 +0000 (+0100) Subject: add 'bench-db' to do very simple database backend performance benchmark X-Git-Tag: auth-3.4.2~15^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02653a7cacee9491dfdb9191bbd9f5ef3cd82ccc;p=thirdparty%2Fpdns.git add 'bench-db' to do very simple database backend performance benchmark --- diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index f486f2c520..a1fab332b8 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -14,6 +14,7 @@ #include "zoneparser-tng.hh" #include "signingpipe.hh" #include "dns_random.hh" +#include #ifdef HAVE_SQLITE3 #include "ssqlite3.hh" #include "bind-dnssec.schema.sqlite3.sql.h" @@ -339,6 +340,49 @@ bool rectifyZone(DNSSECKeeper& dk, const std::string& zone) return true; } +void dbBench(const std::string& fname) +{ + ::arg().set("query-cache-ttl")="0"; + ::arg().set("negquery-cache-ttl")="0"; + UeberBackend B("default"); + + vector domains; + if(!fname.empty()) { + ifstream ifs(fname.c_str()); + if(!ifs) { + cerr<<"Could not open '"<(random())+"."+domain); + while(B.get(rr)) { + } + misses++; + + } + cout<<0.001*dt.udiff()/n<<" millisecond/lookup"< 1 ? cmds[1] : ""); + } else if (cmds[0] == "check-all-zones") { exit(checkAllZones(dk)); }