6#ifndef YARP_PORTMONITOR_STATSMONITOR_H
7#define YARP_PORTMONITOR_STATSMONITOR_H
22 double m_datasize_sum=0;
23 double m_period = 1.0;
24 int m_datasize_count=0;
26 std::string m_destination;
27 std::string m_carrier;
28 std::string m_stats_port_name =
"/testport";
30 bool m_isForward =
true;
40 m_stats_port_name =
"/stats_monitor" + m_source + m_destination +
"/stats:o";
73 std::string m_destination;
74 std::string m_carrier;
75 std::unique_ptr<StatsThread> m_stats_thread_forward;
76 std::unique_ptr<StatsThread> m_stats_thread_backward;
stats_monitor: When this port monitor is attached to the sender side of a connection,...
yarp::os::Things & update(yarp::os::Things &thing) override
After data get accpeted in the accept() callback, an instance of that is given to the update function...
yarp::os::Things & updateReply(yarp::os::Things &thing) override
The updateReply makes it possible to modify a reply from a port when the portmonitor object is attach...
bool create(const yarp::os::Property &options) override
This will be called when the dll is properly loaded by the portmonitor carrier.
void run() override
Loop function.
bool threadInit() override
Initialization method.
void setData(size_t datasize)
StatsThread(const StatsThread &)=delete
StatsThread(double period, std::string src, std::string dest, std::string carrier, bool fw)
void threadRelease() override
Release method.
virtual ~StatsThread()=default
An abstraction for a periodic thread.
PeriodicThread(double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative)
Constructor.
A mini-server for network communication.
A class for storing options and configuration information.
Base class for generic things.