YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
StatsMonitor Class Reference

stats_monitor: When this port monitor is attached to the sender side of a connection, it opens two additional output ports (one for forward data and one for backward data). More...

#include </home/runner/work/yarp-documentation/yarp-documentation/yarp/src/portmonitors/stats_monitor/StatsMonitor.h>

+ Inheritance diagram for StatsMonitor:

Public Member Functions

bool create (const yarp::os::Property &options) override
 This will be called when the dll is properly loaded by the portmonitor carrier.
 
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 where the data can be accessed and modified.
 
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 attached to a two-ways connection (e.g., RPC).
 
- Public Member Functions inherited from yarp::os::MonitorObject
virtual ~MonitorObject ()
 
virtual void destroy ()
 This will be called when the portmonitor object destroyes.
 
virtual bool setparam (const yarp::os::Property &params)
 This will be called when the portmonitor carrier parameters are set via YARP admin port.
 
virtual bool getparam (yarp::os::Property &params)
 This will be called when the portmonitor carrier parameters are requested via YARP admin port.
 
virtual void trig ()
 This will be called when one of the peer connections to the same import port receives data.
 
virtual bool accept (yarp::os::Things &thing)
 This will be called when the data reach the portmonitor object.
 

Detailed Description

stats_monitor: When this port monitor is attached to the sender side of a connection, it opens two additional output ports (one for forward data and one for backward data).

These ports provide statistics about the connection, such as bandwidth usage (in Bytes/s) and the number of writes per second. The names of the two ports are automatically generated according to the following pattern: /stats_monitor/" + m_source + m_destination + "/stats:o" data from source to destination /stats_monitor/" + m_destination + m_source + "/stats:o" data from destination back to source (for example in a rpc connection)

Definition at line 62 of file StatsMonitor.h.

Member Function Documentation

◆ create()

bool StatsMonitor::create ( const yarp::os::Property &  options)
overridevirtual

This will be called when the dll is properly loaded by the portmonitor carrier.

Parameters
optionsA set of useful information of the current connection which the monitor object is attached.
Returns
Returning false will stop the portmonitor object to procced

Reimplemented from yarp::os::MonitorObject.

Definition at line 32 of file StatsMonitor.cpp.

◆ update()

yarp::os::Things & StatsMonitor::update ( yarp::os::Things &  thing)
overridevirtual

After data get accpeted in the accept() callback, an instance of that is given to the update function where the data can be accessed and modified.

Parameters
thingAn instance of yarp::os::Thing object which can be used to typecast the data to the correct type.
Returns
An instance of modified data in form of Thing

Reimplemented from yarp::os::MonitorObject.

Definition at line 60 of file StatsMonitor.cpp.

◆ updateReply()

yarp::os::Things & StatsMonitor::updateReply ( yarp::os::Things &  thing)
overridevirtual

The updateReply makes it possible to modify a reply from a port when the portmonitor object is attached to a two-ways connection (e.g., RPC).

Parameters
thingAn instance of yarp::os::Thing object which can be used to typecast the data to the correct type.
Returns
An instance of modified data in form of Thing

Reimplemented from yarp::os::MonitorObject.

Definition at line 75 of file StatsMonitor.cpp.


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