dodo
0.0.1
A C++ library to create containerized Linux services
|
Go to the documentation of this file.
23 #ifndef threads_thread_hpp
24 #define threads_thread_hpp
31 #include <sys/resource.h>
65 std::thread::id
getId()
const;
197 virtual void run() = 0;
virtual void run()=0
Decsendants must override the run function.
double getAvgVCtx()
Get the average voluntary context switch rate since thread start()
double getAvgMinFltRate()
Get the average minor fault rate since thread start()
std::thread * thread_
The std::tread object.
void wait()
Wait for the thread to join the current thread / wait for the thread to finish.
double getRunTime()
Time, in seconds, since thread start.
pid_t getTID() const
Return the tid.
double getLastMinFltRate()
Get the minor fault rate since last sample.
double getLastMajFltRate()
Get the major fault rate since last sample.
double getLastBlkInRate()
Get last block in rate since last sample.
double getAvgUserCPU()
Get the average user mode cpu (cpu seconds/second) since thread start()
double getLastUserCPU()
Get the user mode cpu (cpu seconds/second) since last sample.
double getLastBlkOutRate()
Get last block out rate since last sample.
void start()
Start the thread.
double getLastICtx()
Get involuntary context switch rate since last sample.
struct rusage rusage_
Last statistics.
struct rusage prev_rusage_
Previous statistics.
std::thread::id getId() const
Get the thread id.
double getAvgICtx()
Get the average involuntary context switch rate since thread start()
void snapRUsage()
Take a snapshot of the thread's resource usage.
double getAvgMajFltRate()
Get the average major fault rate since thread start()
struct timeval snap_time_
Time of last statistics snapshot.
struct timeval prev_snap_time_
Time of previous statistics snapshot.
long getMaxRSS()
Get the maximum resident set size seen on the thread.
double getAvgBlkInRate()
Get the average block in rate since thread start()
double getSnapDiffTime()
Time, in seconds, since last statistic update.
double getLastSysCPU()
Get the system mode cpu (cpu seconds/second) since last sample.
double getAvgSysCPU()
Get the average system mode cpu (cpu seconds/second) since thread start()
virtual ~Thread()
Destructor.
Interface for Thread programming.
double getLastVCtx()
Get voluntary context switch rate since last sample.
struct timeval start_time_
Time Thread started.
static void * thread_method(void *context)
Posix thread method - calls dodo::threads::Thread:::run().
double getAvgBlkOutRate()
Get the average block out rate since thread start()