HSS profiling is used to assist with troubleshooting HyperPoint Scripts in the CygNet HyperPoint Scripting Service (HSS). HSS profiling allows scripts to report their events to an individual log file that is separate from the HSS service log file.
To use HSS profiling, you must enable the LOGMASK_SCRIPT keyword in the HSS configuration file (Hss.cfg) and add the desired profile option(s) from the table below. After saving the Hss.cfg file, stop and restart the service for the change to become effective, since the service reads the file only at startup.
For more information about modifying the HSS configuration file, see Service Configuration Files.
| LOGMASK_SCRIPT Keyword Option | Description |
|---|---|
|
MIN_TRACE |
Enables basic debug logging mode. |
|
MAX_TRACE |
Enables verbose debug logging mode. |
|
PROFILE_MIN |
Enables minimum performance profile logging mode. Displays the end time of an item coming out of scope or completing runtime. |
|
PROFILE_MAX |
Enables maximum performance profile logging mode. Displays the begin and end time of items coming in or out of scope. |
The HyperPoint features for a point must be enabled for a point to use the HSS scripting methods. See Creating and Configuring a HyperPoint for more information.
Note: The Current Value Service of the point must be a service for which scripting is enabled.
In the script editor, the following methods can be used with the available event options to assist with profiling options. See LogManager Methods for more information.
| LogManager Method | Description |
|---|---|
|
LogManager.GetProfiler("message") |
The GetProfiler method writes a profile message to the scripting log file. Returns an object that logs a profile timing message on creation and deletion (object goes in or out of scope). On creation PROFILE_MAX must be set and on deletion (object goes out of scope) PROFILE_MIN must be set. |
|
LogManager.LogAll("message") |
The LogAll method writes the message string to the scripting log file. |
|
LogManager.LogMin("message") |
The LogMin method writes the message string to the scripting log file if MIN_TRACE is set in the HSS service configuration file. |
|
LogManager.LogMax("message") |
The LogMax method writes the message string to the scripting log file if MAX_TRACE is set in the HSS service configuration file. |
Output of the script is captured and displayed in log file(s) located in the working HSS service directory. The HSS profile log files are generated separately from the HSS service log file to keep the profiling items and the HSS service items separate.
The HSS profiling log file is created automatically and follows the log file naming convention below. The HSS service log file's naming convention is also shown to illustrate the difference.
The log file is <service_name>_Script<sequence_number>. log, where <service_name> is the name of the service.
Example: HSS_Script001.log
The HSS service log file is used to capture and trace items on the HSS service. It follows the naming convention below.
Example: HSS001.log
Log files, located in the HSS service folder, can be viewed by double clicking on the log file.
CygNet also has a utility that is designed to ease the view of displaying items in a log file. The Log File Viewer utility, located in the CygNet\Utilities directory, allows you to open, print, and search/filter for data within any log file to assist or aid in troubleshooting.
The generated HSS profile log files can assist in troubleshooting HSS scripts. For example, if the Hss.cfg file is configured with the minimal log settings (MIN_TRACE) to capture only the basic debug items, but the scripting method contains both LogMin and LogMax items in the HyperPoint, only the minimal information will be collected in the HSS_Script001.log file due to the settings in the Hss.cfg file.
The following is an example section of an HSS Script with both LogManager.LogMin and LogManager.LogMax configured.
|
LogManager.LogMin("Begin OnInEx Log Min(LogMin)")
LogManager.LogMax("Begin OnInEx Log Max(LogMax)")
points.AddPoint "MYSITE.HSS::TEST.TESTUDC", this points.AddPoint "MYSITE.HSS::TEST.TESTUDC2"
This.Value = "Init end" |
To collect more logging data to troubleshoot the HSS script for the point in question, you could add PROFILE_MIN and PROFILE_MAX to the existing LOGMASK_SCRIPT keyword in the Hss.cfg file, save the file, and restart the HSS service for the changes to take effect. Logging would then be enabled to display maximum logging to assist in troubleshooting, without editing any HSS HyperPoint scripts. The additions will create entries in the log file at the start of a script runtime (in scope) and at the end time of a script runtime (out of scope).