libDwm-0.6.0
Dwm::Rusage Class Reference

This class encapsulates struct rusage and getrusage() functionality. More...

#include <DwmRusage.hh>

Inheritance diagram for Dwm::Rusage:
Collaboration diagram for Dwm::Rusage:

Public Member Functions

 Rusage ()
 Constructor.
 
 Rusage (const struct rusage &rusage)
 Construct from a struct rusagee.
 
bool Get (int who)
 Get the current process' rusage. More...
 
const TimeValueUserTime () const
 The total amount of time spent executing in user mode.
 
const TimeValueSystemTime () const
 The total amount of time spent in the system executing on behalf of the process(es). More...
 
int64_t MaxResidentSetSize () const
 The maximum resident set size utilized (in bytes).
 
int64_t IntegralSharedTextMemorySize () const
 An integral value indicating the amount of memory used by the text segment that was also shared among other pro- cesses. More...
 
int64_t IntegralUnsharedDataSize () const
 An integral value of the amount of unshared memory residing in the data segment of a process (expressed in units of bytes * ticks-of-execution). More...
 
int64_t IntegralUnsharedStackSize () const
 An integral value of the amount of unshared memory residing in the stack segment of a process (expressed in units of bytes * ticks-of-execution). More...
 
int32_t PageReclaims () const
 The number of page faults serviced without any I/O activity; here I/O activity is avoided by reclaiming a page frame from the list of pages awaiting reallocation. More...
 
int32_t PageFaults () const
 The number of page faults serviced that required I/O activity.
 
int32_t Swaps () const
 The number of times a process was ``swapped'' out of main memory.
 
int32_t BlockInputOperations () const
 The number of times the file system had to perform input.
 
int32_t BlockOutputOperations () const
 The number of times the file system had to perform output.
 
int32_t MessagesSent () const
 The number of IPC messages sent.
 
int32_t MessagesReceived () const
 The number of IPC messages received.
 
int32_t SignalsReceived () const
 The number of signals delivered.
 
int32_t VoluntaryContextSwitches () const
 The number of times a context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource). More...
 
int32_t InvoluntaryContextSwitches () const
 The number of times a context switch resulted due to a higher priority process becoming runnable or because the current process exceeded its time slice. More...
 
std::istream & Read (std::istream &is)
 Reads from an istream. Returns the istream.
 
std::ostream & Write (std::ostream &os) const
 Writes to an ostream. Returns the ostream.
 
int Read (gzFile gzf)
 Reads from a gzFile. More...
 
int Write (gzFile gzf) const
 Writes to a gzFile. More...
 
ssize_t Read (int fd)
 Reads from a file descriptor. More...
 
ssize_t Write (int fd) const
 Writes to a file descriptor. More...
 
size_t Read (FILE *f)
 NOT IMPLEMENTED YET.
 
size_t Write (FILE *f) const
 NOT IMPLEMENTED YET.
 
uint32_t StreamedLength () const
 Returns the number of bytes that would be written if we called one of the Write() members. More...
 
bool operator== (const Rusage &rusage) const
 operator ==
 
- Public Member Functions inherited from Dwm::Readable
virtual ~Readable ()
 destructor
 
- Public Member Functions inherited from Dwm::Writable
virtual ~Writable ()
 Destructor.
 
- Public Member Functions inherited from Dwm::GZReadable
virtual ~GZReadable ()
 destructor
 
- Public Member Functions inherited from Dwm::GZWritable
virtual ~GZWritable ()
 destructor
 

Friends

std::ostream & operator<< (std::ostream &os, const Rusage &r)
 Prints to an ostream.
 

Detailed Description

This class encapsulates struct rusage and getrusage() functionality.

Member Function Documentation

◆ Get()

bool Dwm::Rusage::Get ( int  who)

Get the current process' rusage.

who may be RUSAGE_SELF or RUSAGE_CHILDREN. See the getrusage(2) manpage.

◆ IntegralSharedTextMemorySize()

int64_t Dwm::Rusage::IntegralSharedTextMemorySize ( ) const

An integral value indicating the amount of memory used by the text segment that was also shared among other pro- cesses.

This value is expressed in units of bytes * ticks-of-execution. Ticks are statistics clock ticks. The statistics clock has a frequency of sysconf(_SC_CLK_TCK) ticks per second.

◆ IntegralUnsharedDataSize()

int64_t Dwm::Rusage::IntegralUnsharedDataSize ( ) const

An integral value of the amount of unshared memory residing in the data segment of a process (expressed in units of bytes * ticks-of-execution).

◆ IntegralUnsharedStackSize()

int64_t Dwm::Rusage::IntegralUnsharedStackSize ( ) const

An integral value of the amount of unshared memory residing in the stack segment of a process (expressed in units of bytes * ticks-of-execution).

◆ InvoluntaryContextSwitches()

int32_t Dwm::Rusage::InvoluntaryContextSwitches ( ) const

The number of times a context switch resulted due to a higher priority process becoming runnable or because the current process exceeded its time slice.

◆ PageReclaims()

int32_t Dwm::Rusage::PageReclaims ( ) const

The number of page faults serviced without any I/O activity; here I/O activity is avoided by reclaiming a page frame from the list of pages awaiting reallocation.

◆ Read() [1/2]

int Dwm::Rusage::Read ( gzFile  gzf)
virtual

Reads from a gzFile.

Returns the number of bytes read on success, -1 on failure.

Implements Dwm::GZReadable.

◆ Read() [2/2]

ssize_t Dwm::Rusage::Read ( int  fd)
virtual

Reads from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

Implements Dwm::Readable.

◆ StreamedLength()

uint32_t Dwm::Rusage::StreamedLength ( ) const
virtual

Returns the number of bytes that would be written if we called one of the Write() members.

Implements Dwm::Writable.

◆ SystemTime()

const TimeValue& Dwm::Rusage::SystemTime ( ) const

The total amount of time spent in the system executing on behalf of the process(es).

◆ VoluntaryContextSwitches()

int32_t Dwm::Rusage::VoluntaryContextSwitches ( ) const

The number of times a context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource).

◆ Write() [1/2]

int Dwm::Rusage::Write ( gzFile  gzf) const
virtual

Writes to a gzFile.

Returns the number of bytes written on success, -1 on failure.

Implements Dwm::GZWritable.

◆ Write() [2/2]

ssize_t Dwm::Rusage::Write ( int  fd) const
virtual

Writes to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

Implements Dwm::Writable.


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