dodo  0.0.1
A C++ library to create containerized Linux services
dodo::network::TCPListenerTimer Class Reference

Updates the attribute now_ in the TCPListener at a regular interval to avoid excessive number of calls to gettimeofday in the TCPListener event loop where time high time precision is of lesser importance. More...

Inheritance diagram for dodo::network::TCPListenerTimer:
Collaboration diagram for dodo::network::TCPListenerTimer:

Public Member Functions

 TCPListenerTimer (TCPListener &listener)
 Constructor, specify the TCPListener to operate on. More...
 
virtual void run ()
 Decsendants must override the run function. More...
 
void stop ()
 Stop the timer. More...
 
- Public Member Functions inherited from dodo::threads::Thread
 Thread ()
 Constructor. More...
 
virtual ~Thread ()
 Destructor. More...
 
double getAvgBlkInRate ()
 Get the average block in rate since thread start() More...
 
double getAvgBlkOutRate ()
 Get the average block out rate since thread start() More...
 
double getAvgICtx ()
 Get the average involuntary context switch rate since thread start() More...
 
double getAvgMajFltRate ()
 Get the average major fault rate since thread start() More...
 
double getAvgMinFltRate ()
 Get the average minor fault rate since thread start() More...
 
double getAvgSysCPU ()
 Get the average system mode cpu (cpu seconds/second) since thread start() More...
 
double getAvgUserCPU ()
 Get the average user mode cpu (cpu seconds/second) since thread start() More...
 
double getAvgVCtx ()
 Get the average voluntary context switch rate since thread start() More...
 
std::thread::id getId () const
 Get the thread id. More...
 
double getLastBlkInRate ()
 Get last block in rate since last sample. More...
 
double getLastBlkOutRate ()
 Get last block out rate since last sample. More...
 
double getLastICtx ()
 Get involuntary context switch rate since last sample. More...
 
double getLastMajFltRate ()
 Get the major fault rate since last sample. More...
 
double getLastMinFltRate ()
 Get the minor fault rate since last sample. More...
 
double getLastSysCPU ()
 Get the system mode cpu (cpu seconds/second) since last sample. More...
 
double getLastUserCPU ()
 Get the user mode cpu (cpu seconds/second) since last sample. More...
 
double getLastVCtx ()
 Get voluntary context switch rate since last sample. More...
 
long getMaxRSS ()
 Get the maximum resident set size seen on the thread. More...
 
double getRunTime ()
 Time, in seconds, since thread start. More...
 
double getSnapDiffTime ()
 Time, in seconds, since last statistic update. More...
 
pid_t getTID () const
 Return the tid. More...
 
void snapRUsage ()
 Take a snapshot of the thread's resource usage. More...
 
void start ()
 Start the thread. More...
 
void wait ()
 Wait for the thread to join the current thread / wait for the thread to finish. More...
 

Protected Attributes

TCPListenerlistener_
 The associated TCPListener. More...
 
bool stopped_
 True if stop() was called. More...
 
- Protected Attributes inherited from dodo::threads::Thread
struct rusage prev_rusage_
 Previous statistics. More...
 
struct timeval prev_snap_time_
 Time of previous statistics snapshot. More...
 
struct rusage rusage_
 Last statistics. More...
 
struct timeval snap_time_
 Time of last statistics snapshot. More...
 
struct timeval start_time_
 Time Thread started. More...
 
std::thread * thread_
 The std::tread object. More...
 

Additional Inherited Members

Detailed Description

Updates the attribute now_ in the TCPListener at a regular interval to avoid excessive number of calls to gettimeofday in the TCPListener event loop where time high time precision is of lesser importance.

Definition at line 70 of file tcplistener.cpp.

Constructor & Destructor Documentation

◆ TCPListenerTimer()

dodo::network::TCPListenerTimer::TCPListenerTimer ( TCPListener listener)
inlineexplicit

Constructor, specify the TCPListener to operate on.

Parameters
listenerthe TCPListener to operate on.

Definition at line 76 of file tcplistener.cpp.

Member Function Documentation

◆ run()

virtual void dodo::network::TCPListenerTimer::run ( )
inlinevirtual

Decsendants must override the run function.

Implements dodo::threads::Thread.

Definition at line 83 of file tcplistener.cpp.

◆ stop()

void dodo::network::TCPListenerTimer::stop ( )
inline

Stop the timer.

Definition at line 96 of file tcplistener.cpp.

Field Documentation

◆ listener_

TCPListener& dodo::network::TCPListenerTimer::listener_
protected

The associated TCPListener.

Definition at line 101 of file tcplistener.cpp.

◆ stopped_

bool dodo::network::TCPListenerTimer::stopped_
protected

True if stop() was called.

Definition at line 103 of file tcplistener.cpp.


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