mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +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
|
@ -110,6 +110,8 @@ Trigger::Trigger(Expr* arg_cond, Stmt* arg_body, Stmt* arg_timeout_stmts,
|
|||
is_return = arg_is_return;
|
||||
location = arg_location;
|
||||
|
||||
++total_triggers;
|
||||
|
||||
DBG_LOG(DBG_NOTIFIERS, "%s: instantiating", Name());
|
||||
|
||||
if ( is_return )
|
||||
|
@ -165,6 +167,7 @@ void Trigger::Init()
|
|||
}
|
||||
|
||||
Trigger::TriggerList* Trigger::pending = 0;
|
||||
unsigned long Trigger::total_triggers = 0;
|
||||
|
||||
bool Trigger::Eval()
|
||||
{
|
||||
|
@ -413,3 +416,9 @@ const char* Trigger::Name()
|
|||
return fmt("%s:%d-%d", location->filename,
|
||||
location->first_line, location->last_line);
|
||||
}
|
||||
|
||||
void Trigger::GetStats(Stats* stats)
|
||||
{
|
||||
stats->total = total_triggers;
|
||||
stats->pending = pending ? pending->size() : 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue