S.declare("latency","Average number of microseconds needed to answer a question", getLatency);
S.declare("timedout-packets","Number of packets which weren't answered within timeout set");
S.declare("security-status", "Security status based on regular polling");
- S.declareRing("queries","UDP Queries Received");
- S.declareRing("nxdomain-queries","Queries for non-existent records within existent domains");
- S.declareRing("noerror-queries","Queries for existing records, but for type we don't have");
- S.declareRing("servfail-queries","Queries that could not be answered due to backend errors");
- S.declareRing("unauth-queries","Queries for domains that we are not authoritative for");
+ S.declareDNSNameQTypeRing("queries","UDP Queries Received");
+ S.declareDNSNameQTypeRing("nxdomain-queries","Queries for non-existent records within existent domains");
+ S.declareDNSNameQTypeRing("noerror-queries","Queries for existing records, but for type we don't have");
+ S.declareDNSNameQTypeRing("servfail-queries","Queries that could not be answered due to backend errors");
+ S.declareDNSNameQTypeRing("unauth-queries","Queries for domains that we are not authoritative for");
S.declareRing("logmessages","Log Messages");
S.declareComboRing("remotes","Remote server IP addresses");
S.declareComboRing("remotes-unauth","Remote hosts querying domains for which we are not auth");
if(P->d.qr)
continue;
- S.ringAccount("queries", P->qdomain.toLogString()+"/"+P->qtype.getName());
+ S.ringAccount("queries", P->qdomain, P->qtype);
S.ringAccount("remotes",P->d_remote);
if(logDNSQueries) {
string remote;
if(d_dk.isSecuredZone(sd.qname))
addNSECX(p, r, target, wildcard, sd.qname, mode);
- S.ringAccount("noerror-queries",p->qdomain.toLogString()+"/"+p->qtype.getName());
+ S.ringAccount("noerror-queries", p->qdomain, p->qtype);
}
r=p->replyPacket(); // generate an empty reply packet
r->setRcode(RCode::ServFail);
S.inc("servfail-packets");
- S.ringAccount("servfail-queries",p->qdomain.toLogString());
+ S.ringAccount("servfail-queries", p->qdomain, p->qtype);
}
catch(PDNSException &e) {
g_log<<Logger::Error<<"Backend reported permanent error which prevented lookup ("+e.reason+"), aborting"<<endl;
r=p->replyPacket(); // generate an empty reply packet
r->setRcode(RCode::ServFail);
S.inc("servfail-packets");
- S.ringAccount("servfail-queries",p->qdomain.toLogString());
+ S.ringAccount("servfail-queries", p->qdomain, p->qtype);
}
return r;
if(p.d.aa) {
if (p.d.rcode==RCode::NXDomain)
- S.ringAccount("nxdomain-queries",p.qdomain.toLogString()+"/"+p.qtype.getName());
+ S.ringAccount("nxdomain-queries", p.qdomain, p.qtype);
} else if (p.d.rcode == RCode::Refused) {
- S.ringAccount("unauth-queries",p.qdomain.toLogString()+"/"+p.qtype.getName());
+ S.ringAccount("unauth-queries", p.qdomain, p.qtype);
S.ringAccount("remotes-unauth",p.d_remote);
}
ret<<"Total queries: "<<S.read("udp-queries")<<". Question/answer latency: "<<S.read("latency")/1000.0<<"ms</p><br>"<<endl;
if(req->getvars["ring"].empty()) {
- vector<string>entries=S.listRings();
- for(vector<string>::const_iterator i=entries.begin();i!=entries.end();++i)
- printtable(ret,*i,S.getRingTitle(*i));
+ auto entries = S.listRings();
+ for(const auto &i: entries) {
+ printtable(ret, i, S.getRingTitle(i));
+ }
printvars(ret);
if(arg().mustDo("webserver-print-arguments"))