Description

Functions

   
   
size_t getResidentSetMemorySize()
   
size_t getVirtualMemorySize()
   
size_t getAllocatedMemorySize()
   
void outputProcessMemory()
   
size_t getIOBytesRead()
   
size_t getIOBytesWritten()
   
void outputProcessIO()
   
void sleep(unsigned long int ms)
   
int32_t getProcessId()
   
std::string getExecutablePath()
   
double getCPUUsage(unsigned long int timespan)
   
std::vector< std::string > getBacktrace()
   
std::string createTimeStamp()

Documentation

function
Util::Utils::getResidentSetMemorySize

public
   
   
size_t getResidentSetMemorySize( )

Get the resident set size/working set size of the current process.

Returns

Memory size in bytes or 0 if this function is not supported on this platform.

See also: proc(5)

See also: http://msdn.microsoft.com/en-us/library/ms684877(VS.85).aspx

Defined in Util/Utils.h:35


function
Util::Utils::getVirtualMemorySize

public
   
   
size_t getVirtualMemorySize( )

Get the virtual memory size/pagefile space of the current process.

Returns

Memory size in bytes or 0 if this function is not supported on this platform.

See also: proc(5)

See also: http://msdn.microsoft.com/en-us/library/ms684877(VS.85).aspx

Defined in Util/Utils.h:44


function
Util::Utils::getAllocatedMemorySize

public
   
   
size_t getAllocatedMemorySize( )

Get the dynamic memory allocation size of the current process.

Returns

Memory size in bytes or 0 if this function is not supported on this platform.

See also: mallinfo(3)

Defined in Util/Utils.h:52


function
Util::Utils::outputProcessMemory

public
   
   
void outputProcessMemory( )

Output memory usage information to standard output.

Defined in Util/Utils.h:57


function
Util::Utils::getIOBytesRead

public
   
   
size_t getIOBytesRead( )

Get the number of bytes that were read by this process.

Returns

Number of bytes or 0 if this function is not supported on this platform.

See also: Documentation/filesystems/proc.txt

See also: http://msdn.microsoft.com/en-us/library/ms683218(VS.85).aspx

Defined in Util/Utils.h:66


function
Util::Utils::getIOBytesWritten

public
   
   
size_t getIOBytesWritten( )

Get the number of bytes that were written by this process.

Returns

Number of bytes or 0 if this function is not supported on this platform.

See also: Documentation/filesystems/proc.txt

See also: http://msdn.microsoft.com/en-us/library/ms683218(VS.85).aspx

Defined in Util/Utils.h:75


function
Util::Utils::outputProcessIO

public
   
   
void outputProcessIO( )

Output IO usage information to standard output.

Defined in Util/Utils.h:80


function
Util::Utils::sleep

public
     
     
void sleep( unsigned long int ms )

Put the thread to sleep for the specified number of milliseconds.

Parameters

ms
Number of milliseconds.

See also: CLOCK_NANOSLEEP(2)

See also: http://msdn.microsoft.com/en-us/library/ms686298(VS.85).aspx

Defined in Util/Utils.h:89


function
Util::Utils::getProcessId

public
   
   
int32_t getProcessId( )

Return the identifier of the calling process.

Returns

Process identifier specific to the running operating system or -1 if the function is not implemented for the running operating system.

Defined in Util/Utils.h:97


function
Util::Utils::getExecutablePath

public
   
   
std::string getExecutablePath( )

Return the path of the currently running executable.

Returns

Absolute path of the executable or an empty string, if the path could not be retrieved.

Defined in Util/Utils.h:105


function
Util::Utils::getCPUUsage

public
     
     
double getCPUUsage( unsigned long int timespan )

Return the overall CPU usage of the system.

Parameters

timespan
Timespan in milliseconds to monitor the CPU usage for

Returns

Overall CPU usage from [0, 1] independent of the number of CPUs, or -1.0 if the function is not implemented for the running operating system.

Note: The function might block for at leasttimespanmilliseconds.

Defined in Util/Utils.h:115


function
Util::Utils::getBacktrace

public
   
   
std::vector< std::string > getBacktrace( )

Get a backtrace for the calling function.

Returns

Series of function calls of the program. The most recent function call is at the beginning.

Note: The function getBacktrace() itself may be part of the backtrace.

Note: If the needed functionality is not available on your system, a warning message will be emitted and an empty array will be returned.

Defined in Util/Utils.h:126


function
Util::Utils::createTimeStamp

public
   
   
std::string createTimeStamp( )

Return a string containing a time stamp. It contains the current date, the current time, and a time zone identifier. For example, the string could be “2013-03-21_16-16-45_CET”.

Returns

String containing a time stamp

Defined in Util/Utils.h:135