]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/responsestats.hh
092c2b6386174e8191edcf91fd67a9559eb18391
[thirdparty/pdns.git] / pdns / responsestats.hh
1 #pragma once
2 #include "misc.hh"
3 #include "dnspacket.hh"
4
5 class ResponseStats
6 {
7 public:
8 ResponseStats();
9
10 void submitResponse(DNSPacket &p, bool udpOrTCP);
11 void submitResponse(uint16_t qtype, uint16_t respsize, bool udpOrTCP);
12 map<uint16_t, uint64_t> getQTypeResponseCounts();
13 map<uint16_t, uint64_t> getSizeResponseCounts();
14 string getQTypeReport();
15
16 private:
17 boost::scoped_array<std::atomic<unsigned long>> d_qtypecounters;
18 typedef vector<pair<uint16_t, uint64_t> > sizecounters_t;
19 sizecounters_t d_sizecounters;
20 };
21
22 extern ResponseStats g_rs;