Skip to content

Commit

Permalink
Adjust Stats plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Zadamsa committed Oct 3, 2024
1 parent 6963127 commit f3f64ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions process/stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ ProcessPlugin *StatsPlugin::copy()
return new StatsPlugin(*this);
}

int StatsPlugin::post_create(Flow &rec, const Packet &pkt)
ProcessPlugin::FlowAction StatsPlugin::post_create(Flow &rec, const Packet &pkt)
{
m_packets += 1;
m_new_flows += 1;
m_flows_in_cache += 1;
check_timestamp(pkt);
return 0;
return ProcessPlugin::FlowAction::GET_ALL_DATA;
}

int StatsPlugin::post_update(Flow &rec, const Packet &pkt)
ProcessPlugin::FlowAction StatsPlugin::post_update(Flow &rec, const Packet &pkt)
{
m_packets += 1;
m_cache_hits += 1;
check_timestamp(pkt);
return 0;
return ProcessPlugin::FlowAction::GET_ALL_DATA;
}

void StatsPlugin::pre_export(Flow &rec)
Expand Down
4 changes: 2 additions & 2 deletions process/stats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class StatsPlugin : public ProcessPlugin
std::string get_name() const { return "stats"; }
ProcessPlugin *copy();

int post_create(Flow &rec, const Packet &pkt);
int post_update(Flow &rec, const Packet &pkt);
ProcessPlugin::FlowAction post_create(Flow &rec, const Packet &pkt);
ProcessPlugin::FlowAction post_update(Flow &rec, const Packet &pkt);
void pre_export(Flow &rec);
void finish(bool print_stats);

Expand Down

0 comments on commit f3f64ac

Please sign in to comment.