1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

stats: fix initialization of sub-hooks

This commit is contained in:
Steffen Vogel 2021-07-13 11:22:40 +02:00
parent efd64ea7fc
commit f0da62b8f0
2 changed files with 9 additions and 6 deletions

View file

@ -39,6 +39,7 @@ using namespace villas;
using namespace villas::node;
Hook::Hook(struct vpath *p, struct vnode *n, int fl, int prio, bool en) :
logger(logging.get("hook")),
state(State::INITIALIZED),
flags(fl),
priority(prio),

View file

@ -48,16 +48,17 @@ public:
Hook(p, n, fl, prio, en),
parent(pa)
{
state = State::CHECKED;
/* This hook has no config. We never call parse() for it */
state = State::PARSED;
}
virtual Hook::Reason process(sample *smp);
virtual Hook::Reason process(struct sample *smp);
};
class StatsReadHook : public Hook {
protected:
sample *last;
struct sample *last;
StatsHook *parent;
@ -67,7 +68,8 @@ public:
last(nullptr),
parent(pa)
{
state = State::CHECKED;
/* This hook has no config. We never call parse() for it */
state = State::PARSED;
}
virtual void start()
@ -238,7 +240,7 @@ public:
}
};
Hook::Reason StatsWriteHook::process(sample *smp)
Hook::Reason StatsWriteHook::process(struct sample *smp)
{
timespec now = time_now();
@ -247,7 +249,7 @@ Hook::Reason StatsWriteHook::process(sample *smp)
return Reason::OK;
}
Hook::Reason StatsReadHook::process(sample *smp)
Hook::Reason StatsReadHook::process(struct sample *smp)
{
if (last) {
if (smp->flags & last->flags & (int) SampleFlags::HAS_TS_RECEIVED)