mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Remove concept of multiple timer managers
- All timers are now handled by a single global timer manager, which simplifies how they handled by the IOSource manager. - This change flows down a number of changes to other parts of the code. The timer manager tag field is removed, which means that matching connections to a timer manager is also removed. This removes the ability to tag a connection as internal or external, since that's how the connections where differentiated. This in turn removes the `current_conns_extern` field from the `ConnStats` record type in the script layer.
This commit is contained in:
parent
2dcc936787
commit
be42608b51
15 changed files with 28 additions and 284 deletions
|
@ -104,8 +104,6 @@ public:
|
|||
|
||||
double Time() const { return t ? t : 1; } // 1 > 0
|
||||
|
||||
const std::string& GetTag() const { return tag; }
|
||||
|
||||
virtual int Size() const = 0;
|
||||
virtual int PeakSize() const = 0;
|
||||
virtual uint64_t CumulativeNum() const = 0;
|
||||
|
@ -122,7 +120,7 @@ public:
|
|||
// IOSource API methods
|
||||
virtual double GetNextTimeout() override { return -1; }
|
||||
virtual void Process() override;
|
||||
virtual const char* Tag() override { return fmt("TimerMgr %s", tag.c_str()); }
|
||||
virtual const char* Tag() override { return "TimerMgr"; }
|
||||
|
||||
/**
|
||||
* Performs some extra initialization on a timer manager. This shouldn't
|
||||
|
@ -131,7 +129,7 @@ public:
|
|||
void InitPostScript();
|
||||
|
||||
protected:
|
||||
explicit TimerMgr(const std::string& arg_tag);
|
||||
TimerMgr();
|
||||
|
||||
virtual int DoAdvance(double t, int max_expire) = 0;
|
||||
virtual void Remove(Timer* timer) = 0;
|
||||
|
@ -139,7 +137,6 @@ protected:
|
|||
double t;
|
||||
double last_timestamp;
|
||||
double last_advance;
|
||||
std::string tag;
|
||||
|
||||
int num_expired;
|
||||
|
||||
|
@ -148,7 +145,7 @@ protected:
|
|||
|
||||
class PQ_TimerMgr : public TimerMgr {
|
||||
public:
|
||||
explicit PQ_TimerMgr(const std::string& arg_tag);
|
||||
PQ_TimerMgr();
|
||||
~PQ_TimerMgr() override;
|
||||
|
||||
void Add(Timer* timer) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue