<<

NAME

Inca::Process::Usage - Data object to store the system usage of a process

SYNOPSIS

  use Inca::Process::Usage;
  my $usage = new Inca::Process::Usage();
  $usage->setMemory( 100 );
  $usage->setCpuTime( 2 );
  $usage->setWallClockTime( 5 );

DESCRIPTION

Describes the system usage of a process in terms of cpu usage, memory usage, and wall clock time. This object is used by the Inca::Process::Profiler module to store monitoring data for a process while it is executing.

CLASS METHODS

new( )

Class constructor which returns a new Inca::Process::Usage object.

getCpuTime( )

Get the CPU time used by a process in seconds.

Returns:

An integer representing the number of CPU seconds used by the process.

getMemory( )

Get the memory usage of a process in megabytes (MB).

Returns:

An integer representing the number of megabytes of memory used by the process.

getWallClockTime( )

Get the wall clock (or elapsed time) for a process in seconds.

Returns:

An integer representing the wall clock (or elapsed time) for a process in seconds.

greaterThan( $usage )

Compare the calling object to the passed Inca::Process::Usage object and return true if the calling object is greater than the passed object.

Returns:

A true value if the calling object is greater than the passed object; otherwise returns true.

hasCpuTime( )

Check to see if a value for CPU time has been set.

Returns:

Returns true if a value for CPU time has been set and is positive; otherwise returns false.

hasMemory( )

Check to see if a value for memory has been set.

Returns:

Returns true if a value for memory has been set and is positive; otherwise returns false.

hasWallClockTime( )

Check to see if a value for wall clock time has been set.

Returns:

Returns true if a value for wall clock time has been set and is positive; otherwise returns false.

limitsExceededString( $usage )

Compare the calling object to the passed Inca::Process::Usage object and return a string representation of whether the calling object is greater than the passed object (e.g., 'wall clock time of X is greater than limit Y').

Arguments:

usage

An object of type Inca::Process::Usage.

Returns:

A string representation of whether the calling object is greater than the limits represented in the passed object.

setCpuTime( $seconds )

Set the CPU time used by a process in seconds.

Arguments:

seconds

An integer representing the number of CPU seconds used by the process.

setMemory( $megabytes )

Set the memory usage of a process in megabytes (MB).

Arguments:

megabytes

An integer representing the number of megabytes of memory used by the process.

setWallClockTime( $seconds )

Set the wall clock (or elapsed time) for a process in seconds.

Arguments:

seconds

An integer representing the wall clock (or elapsed time) for a process in seconds.

zeroValues( )

Set all values to 0.

toString( )

Return the contents of the object as name=value pairs on separate lines.

Returns:

A string containing the contents of the object in name=value pairs.

AUTHOR

Shava Smallen <ssmallen@sdsc.edu>

CAVEATS/WARNINGS

No known problems.

<<