From 02653a7cacee9491dfdb9191bbd9f5ef3cd82ccc Mon Sep 17 00:00:00 2001 From: bert hubert Date: Thu, 11 Dec 2014 12:18:13 +0100 Subject: [PATCH] add 'bench-db' to do very simple database backend performance benchmark --- pdns/pdnssec.cc | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index f486f2c52..a1fab332b 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)); } -- 2.40.0