|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.engine.IlrRuntime
public final class IlrRuntime
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 |
---|
public PrintStream out
This stream is used to print information. It is set initially
to System.out
.
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 |
---|
public IlrRuntime()
Constructs an IlrRuntime
with no arguments.
Method Detail |
---|
public void memorySnapshot()
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
.
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.
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()
.
message
- A message used to identify what consumed the memory.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()
.
message
- A message used to identify what consumed the
elapsed time.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.
nrules
- The number of rules fired in the elapsed time.
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |