Class ILLIXR::network_latency_tx
ClassList > ILLIXR > network_latency_tx
Network latency measurement client plugin (TX side). More...
#include <plugin.hpp>
Inherits the following classes: ILLIXR::threadloop
Public Functions
| Type | Name |
|---|---|
| network_latency_tx (const std::string & name, phonebook * pb) Construct the network latency client plugin. |
|
| virtual void | start () override A method which Spindle calls when it starts the component. |
| virtual void | stop () override A method which Spindle calls when it stops the component. |
Public Functions inherited from ILLIXR::threadloop
| Type | Name |
|---|---|
| virtual void | internal_stop () Stops the thread. |
| virtual void | start () override Starts the thread. |
| virtual void | stop () override Joins the thread. |
| threadloop (const std::string & name, phonebook * pb) |
|
| ~threadloop () override |
Public Functions inherited from ILLIXR::plugin
See ILLIXR::plugin
| Type | Name |
|---|---|
| std::string | get_name () noexcept const |
| plugin (std::string name, phonebook * pb) |
|
| void | spd_add_file_sink (const std::string & file_name, const std::string & extension, const std::string & log_level) |
| auto | spdlogger (const char * log_level) |
| virtual void | start () A method which Spindle calls when it starts the component. |
| virtual void | stop () A method which Spindle calls when it stops the component. |
| virtual | ~plugin () = default |
Protected Types inherited from ILLIXR::threadloop
| Type | Name |
|---|---|
| enum | skip_option |
Protected Attributes inherited from ILLIXR::threadloop
| Type | Name |
|---|---|
| std::size_t | iteration_no = 0 |
| std::size_t | skip_no = 0 |
Protected Attributes inherited from ILLIXR::plugin
See ILLIXR::plugin
| Type | Name |
|---|---|
| const std::size_t | id_ |
| std::string | name_ |
| const phonebook * | phonebook_ |
| std::shared_ptr< spdlog::logger > | plugin_logger_ |
| const std::shared_ptr< record_logger > | record_logger_ |
Protected Functions
| Type | Name |
|---|---|
| virtual void | _p_one_iteration () override Main iteration - sends ping and processes any received pongs. |
| virtual skip_option | _p_should_skip () override Determines if the iteration should be skipped. |
Protected Functions inherited from ILLIXR::threadloop
| Type | Name |
|---|---|
| virtual void | _p_one_iteration () = 0 Override with the computation the thread does every loop. |
| virtual skip_option | _p_should_skip () Gets called in a tight loop, to gate the invocation of _p_one_iteration() __ |
| virtual void | _p_thread_setup () Gets called at setup time, from the new thread. |
| bool | should_terminate () Whether the thread has been asked to terminate. |
Detailed Description
This plugin sends ping packets to a server and receives pong responses via the pong_rx subplugin. The pong_rx plugin calculates round-trip network latency and clock offset, publishing results to the switchboard for other plugins to consume.
The tcp_network_backend plugin handles the actual network transport. This plugin publishes pings to a switchboard topic (which tcp_network_backend transmits over the network) and reads pongs from another topic (which tcp_network_backend populates from network data).
Environment Variables: * NETWORK_LATENCY_INTERVAL_MS: Interval between pings in milliseconds (default: 100)
Public Functions Documentation
function network_latency_tx
Construct the network latency client plugin.
ILLIXR::network_latency_tx::network_latency_tx (
const std::string & name,
phonebook * pb
)
Parameters:
name_Plugin namepb_Phonebook pointer for accessing services
function start
A method which Spindle calls when it starts the component.
virtual void ILLIXR::network_latency_tx::start () override
This is necessary because a constructor can't call derived virtual methods (due to structure of C++). See threadloop for an example of this use-case.
Implements ILLIXR::plugin::start
function stop
A method which Spindle calls when it stops the component.
virtual void ILLIXR::network_latency_tx::stop () override
This is necessary because the parent class might define some actions that need to be taken prior to destructing the derived class. For example, threadloop must halt and join the thread before the derived class can be safely destructed. However, the derived class's destructor is called before its parent (threadloop), so threadloop doesn't get a chance to join the thread before the derived class is destroyed, and the thread accesses freed memory. Instead, we call plugin->stop manually before destroying anything.
Concrete plugins are responsible for initializing their specific logger and sinks.
Implements ILLIXR::plugin::stop
Protected Functions Documentation
function _p_one_iteration
Main iteration - sends ping and processes any received pongs.
virtual void ILLIXR::network_latency_tx::_p_one_iteration () override
Implements ILLIXR::threadloop::_p_one_iteration
function _p_should_skip
Determines if the iteration should be skipped.
virtual skip_option ILLIXR::network_latency_tx::_p_should_skip () override
Returns:
skip_option indicating whether to run or skip
Implements ILLIXR::threadloop::_p_should_skip
The documentation for this class was generated from the following file /home/friedel/devel/ILLIXR/illixr_release/ILLIXR/plugins/network_latency/tx/plugin.hpp