Using Functions
This section assumes you understand how to use TIBCO BusinessEvents functions. It tells you which functions to use and the effect of each function.
- To turn the Profiler on
- In your rule or rule function, use the following function to turn on the Profiler:
Engine.Profiler.startCollectingToFile(String fileName, int level, long duration)
The above function turns on the TIBCO BusinessEvents Profiler and starts collecting data for the specified duration for the agent in which the rule or rule function that calls this function is executed. The Profiler starts collecting data at the beginning of next RTC.
Profile data is output to the specified file in comma-separated value format at the end of the duration period, unless the Profiler is turned off before the end of the duration, in which case it is output at the end of the RTC that completes after the Profiler is turned off.
Input arguments are the same as the engine properties show in Profiler Configuration Properties:
String fileName: See be.engine.profile.Agent_Class_Name.file
int level: See be.engine.profile.Agent_Class_Name.level
long duration: See be.engine.profile.Agent_Class_Name.duration (Here Agent_Class_Name is the current agent in which the rule or rule function that calls this function is executed.)
- To turn the Profiler off
- In your rule or rule function, use the following function to turn off the Profiler:
Engine.Profiler.stopCollecting()
The above function turns off the TIBCO BusinessEvents Profiler and writes the profile data to a file for the agent in which the rule or rule function that calls this function is included (the file is output at the end of the RTC that completes after the Profiler is turned off). There is no effect if the Profiler is not on.