~TeeAction() override;
DNSAction::Action operator()(DNSQuestion* dq, string* ruleresult) const override;
string toString() const override;
- std::unordered_map<string, double> getStats() const override;
+ std::map<string, double> getStats() const override;
private:
ComboAddress d_remote;
return "tee to "+d_remote.toStringWithPort();
}
-std::unordered_map<string,double> TeeAction::getStats() const
+std::map<string,double> TeeAction::getStats() const
{
return {{"queries", d_queries},
{"responses", d_responses},
{
}
virtual string toString() const = 0;
- virtual std::unordered_map<string, double> getStats() const
+ virtual std::map<string, double> getStats() const
{
return {{}};
}
# check the TeeAction stats
stats = self.sendConsoleCommand("getAction(0):printStats()")
- self.assertEquals(stats, """refuseds\t0
+ self.assertEquals(stats, """noerrors\t%d
nxdomains\t0
-noerrors\t%d
-servfails\t0
+other-rcode\t0
+queries\t%d
recv-errors\t0
-tcp-drops\t0
+refuseds\t0
responses\t%d
-other-rcode\t0
send-errors\t0
-queries\t%d
+servfails\t0
+tcp-drops\t0
""" % (numberOfQueries, numberOfQueries, numberOfQueries))
def testTeeWithoutECS(self):
# check the TeeAction stats
stats = self.sendConsoleCommand("getAction(0):printStats()")
- self.assertEquals(stats, """refuseds\t0
+ self.assertEquals(stats, """noerrors\t%d
nxdomains\t0
-noerrors\t%d
-servfails\t0
+other-rcode\t0
+queries\t%d
recv-errors\t0
-tcp-drops\t0
+refuseds\t0
responses\t%d
-other-rcode\t0
send-errors\t0
-queries\t%d
+servfails\t0
+tcp-drops\t0
""" % (numberOfQueries, numberOfQueries, numberOfQueries))