MADARA  3.4.1
madara::filters::CounterFilter Class Reference

Filter for discovering neighboring peers. More...

#include <CounterFilter.h>

Inheritance diagram for madara::filters::CounterFilter:
madara::filters::AggregateFilter

Public Member Functions

 CounterFilter ()
 Constructor. More...
 
virtual ~CounterFilter ()
 Destructor. More...
 
virtual void filter (knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context, knowledge::Variables &vars)
 Adds to the counter. More...
 
knowledge::KnowledgeRecord::Integer get_count ()
 Gets the number of packets filtered. More...
 
knowledge::KnowledgeRecord::Integer get_elapsed ()
 Returns the duration of filtering from first to last message in nanoseconds. More...
 
double get_throughput ()
 Returns the throughput in terms of packets/second. More...
 

Protected Attributes

knowledge::KnowledgeRecord::Integer first_message_
 The time to keep record of a peer. More...
 
bool initialized_
 Tracks if the first timer has been initialized. More...
 
knowledge::KnowledgeRecord::Integer last_message_
 The time of the last clear of the peer_list. More...
 
knowledge::KnowledgeRecord::Integer packets_
 A map of discovered peers. More...
 

Detailed Description

Filter for discovering neighboring peers.

Definition at line 35 of file CounterFilter.h.

Constructor & Destructor Documentation

◆ CounterFilter()

madara::filters::CounterFilter::CounterFilter ( )

Constructor.

Definition at line 7 of file CounterFilter.cpp.

◆ ~CounterFilter()

madara::filters::CounterFilter::~CounterFilter ( )
virtual

Destructor.

Definition at line 12 of file CounterFilter.cpp.

Member Function Documentation

◆ filter()

void madara::filters::CounterFilter::filter ( knowledge::KnowledgeMap records,
const transport::TransportContext transport_context,
knowledge::Variables vars 
)
virtual

Adds to the counter.

Parameters
recordsthe aggregate records vector
transport_contextcontext for querying transport state
varscontext for querying current program state

Implements madara::filters::AggregateFilter.

Definition at line 14 of file CounterFilter.cpp.

◆ get_count()

madara::knowledge::KnowledgeRecord::Integer madara::filters::CounterFilter::get_count ( void  )
inline

Gets the number of packets filtered.

Returns
the number of packets

Definition at line 7 of file CounterFilter.inl.

◆ get_elapsed()

madara::knowledge::KnowledgeRecord::Integer madara::filters::CounterFilter::get_elapsed ( )
inline

Returns the duration of filtering from first to last message in nanoseconds.

Returns
test duration in nanoseconds

Definition at line 13 of file CounterFilter.inl.

◆ get_throughput()

double madara::filters::CounterFilter::get_throughput ( )
inline

Returns the throughput in terms of packets/second.

Returns
packet throughput

Definition at line 25 of file CounterFilter.inl.

Member Data Documentation

◆ first_message_

knowledge::KnowledgeRecord::Integer madara::filters::CounterFilter::first_message_
protected

The time to keep record of a peer.

Definition at line 91 of file CounterFilter.h.

◆ initialized_

bool madara::filters::CounterFilter::initialized_
protected

Tracks if the first timer has been initialized.

Definition at line 81 of file CounterFilter.h.

◆ last_message_

knowledge::KnowledgeRecord::Integer madara::filters::CounterFilter::last_message_
protected

The time of the last clear of the peer_list.

Definition at line 96 of file CounterFilter.h.

◆ packets_

knowledge::KnowledgeRecord::Integer madara::filters::CounterFilter::packets_
protected

A map of discovered peers.

Definition at line 86 of file CounterFilter.h.


The documentation for this class was generated from the following files: