Rule Execution Server API

ilog.rules.engine
Class IlrRuntime

java.lang.Object
  extended by ilog.rules.engine.IlrRuntime

public final class IlrRuntime
extends Object

This class is a utility for displaying information about memory and elapsed time used to execute a section of code.


Field Summary
 PrintStream out
          This stream is used to print information.
static IlrRuntime self
          This field points to an instance of the class.
 
Constructor Summary
IlrRuntime()
          Constructs an IlrRuntime with no arguments.
 
Method Summary
 void memorySnapshot()
          Performs a runtime memory snapshot.
 void printMemoryUsage(String message)
          Prints the memory usage at some point of the execution.
 void printTimeUsage(int nrules)
          Prints the time usage at some point of the execution using a specified number of fired rules.
 void printTimeUsage(String message)
          Prints the time usage at some point of the execution.
 void timeSnapshot()
          Requests the current time using System.currentTimeMillis(), calculates the difference with the last call of this method, and keeps it for later use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

public PrintStream out

This stream is used to print information. It is set initially to System.out.


self

public static IlrRuntime self

This field points to an instance of the class. It is created so that the application can use it directly.

Constructor Detail

IlrRuntime

public IlrRuntime()

Constructs an IlrRuntime with no arguments.

Method Detail

memorySnapshot

public void memorySnapshot()
Performs a runtime memory snapshot.

This method forces the GC to run to:

The difference should represent the memory required by some section of code. The first invocation of this method allows the object to initialize its internal data. The second and following calls will let it compute the difference with the previous one. This class uses the methods of java.lang.Runtime.


timeSnapshot

public void timeSnapshot()

Requests the current time using System.currentTimeMillis(), calculates the difference with the last call of this method, and keeps it for later use. The first call initializes internal data, the second and following calls compute the time difference between the last one.


printMemoryUsage

public void printMemoryUsage(String message)

Prints the memory usage at some point of the execution. This method uses the consumed memory space computed by the last call to memorySnapshot().

Parameters:
message - A message used to identify what consumed the memory.

printTimeUsage

public void printTimeUsage(String message)

Prints the time usage at some point of the execution. This method uses the consumed time computed by the last call to timeSnapshot().

Parameters:
message - A message used to identify what consumed the elapsed time.

printTimeUsage

public void printTimeUsage(int nrules)

Prints the time usage at some point of the execution using a specified number of fired rules. This method uses the consumed time computed by the last call to timeSnapshot() and prints the number of rules fired per second.

Parameters:
nrules - The number of rules fired in the elapsed time.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013