Skip to content

Commit

Permalink
feat: Stats wrapper to better name exported statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
optdcw committed Nov 13, 2023
1 parent 6549223 commit 2aa92cd
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions storage/basic/flowcachehiear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,39 @@
#include "hiearchyflowstore.hpp"
#include "cachedflowstore.hpp"
#include "flowstorestatswriter.hpp"
#include "flowstorepacketindexer.hpp"

#include <boost/core/demangle.hpp>


extern "C" {
struct FilteredStore {};
struct BaseStore {};
}

namespace ipxp {

template <typename F, typename Label>
class FlowStoreStatsWrapper : public FlowStoreProxySimple<F>
{
public:
typedef typename F::packet_info PacketInfo;
typedef typename F::accessor Access;
typedef typename F::iterator Iter;
typedef typename F::parser Parser;

FlowStoreStat::Ptr stats_export() {
auto ptr = this->m_flowstore.stats_export();
std::string label = boost::core::demangle(typeid(Label).name());
ptr->setName(label);
return ptr;
};
};

Plugin *cons_cached_storage_func()
{
return new ipxp::FlowCache<
FlowStorePacketIndexer<
FlowStoreStatsWriter<
FlowStoreMonitor<
FlowStoreCached<
Expand All @@ -25,6 +52,7 @@ Plugin *cons_cached_storage_func()
>
>
>
>
>("cachedStorage");
};

Expand Down

0 comments on commit 2aa92cd

Please sign in to comment.