mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 03:58:20 +00:00
Profiling support for DNS_Mgr and triggers.
With misc/profiling.bro, both now report a line in prof.log with some counters on usage.
This commit is contained in:
parent
bd9c937236
commit
df4a22a27d
6 changed files with 77 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef dnsmgr_h
|
||||
#define dnsmgr_h
|
||||
|
@ -81,6 +81,17 @@ public:
|
|||
void AsyncLookupAddr(dns_mgr_addr_type host, LookupCallback* callback);
|
||||
void AsyncLookupName(string name, LookupCallback* callback);
|
||||
|
||||
struct Stats {
|
||||
unsigned long requests; // These count only async requests.
|
||||
unsigned long successful;
|
||||
unsigned long failed;
|
||||
unsigned long pending;
|
||||
unsigned long cached_hosts;
|
||||
unsigned long cached_addresses;
|
||||
};
|
||||
|
||||
void GetStats(Stats* stats);
|
||||
|
||||
protected:
|
||||
friend class LookupCallback;
|
||||
friend class DNS_Mgr_Request;
|
||||
|
@ -206,6 +217,10 @@ protected:
|
|||
TimeoutQueue asyncs_timeouts;
|
||||
|
||||
int asyncs_pending;
|
||||
|
||||
unsigned long num_requests;
|
||||
unsigned long successful;
|
||||
unsigned long failed;
|
||||
};
|
||||
|
||||
extern DNS_Mgr* dns_mgr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue