Most Frequently Run (Python Programs)
The Python branch of the Server Status Tool includes a Most Frequently Run category. You can use this category to assess which Python programs are executed the most often. You might also find it useful for investigating potential performance issues with frequently-run Python programs. The statistics relate to Python programs that the Geo SCADA Expert server is configured to execute. They do not relate to Python programs that you execute by other means outside of Geo SCADA Expert to interact with the Geo SCADA Expert database.
Each entry in the Most Frequently Run category represents a Python program for which the Python code is stored in a Python Program item in the database. The category shows those Python programs that the server has run the most often. By default, the top 10 programs are displayed. The entries are displayed sorted by Run Count, in descending order, by default.
The information for each entry is categorized as follows:
- Object Id—A unique number that Geo SCADA Expert uses to identify the Python Program item in the database.
- Name—The full name of the Python Program item, including its full path in the database.
- Run Count—The number of times that the Python program has run since the statistics were last reset.
If a particular program has an unexpectedly high Run Count, you might want to check the following:
If the program is configured to execute on a 'Periodic' basis, check whether it is configured to run at the appropriate Interval.
If the program is configured to run on an 'On Object Change' basis, check whether there is an issue with the database item that is configured as the Python program's On Change Object.
If the program is configured to run on a 'Method' basis, check whether there is an issue with any applications (or other Python programs) that are configured to trigger the Run method for the Python program.
For information about the Trigger Conditions that you can configure for a Python program, see Define the Run Settings of a Python Program.
You might also want to check the program code of the Python program (see Write and Edit the Program Code in a Python Program).
- Average Runtime—The average time that the Python program takes to run.
If the average runtime for a particular Python program looks unexpectedly longer than others, review the Python code for that program.
- Longest Runtime—The longest time that the Python program has taken to run since the statistics were last reset.
- Completion of Longest Runtime—The completion date and time of the run that took the longest time to complete.
If one run took a substantially longer time than other runs of the same Python program, you might want to check other data, such as entries in the Events List from around this time. This might help to identify the potential cause of that long runtime.
- Run Timeouts—The number of times that a run of the Python program has been aborted before the program has run to completion, due to the Python program exceeding its Runtime Limit.
For more information, see Longest Running (Python Programs).
- Discarded Pending Executions—The number of run requests that the server has discarded due to an Execution Queue Limit being exceeded. Each program-specific Execution Queue Limit works in conjunction with the server's Execution Queue Limit. For examples that demonstrate how the two settings work, see Define the Program Limits on the Server. Once either limit has been exceeded, the server discards any further 'Run' requests.
If a particular program has an unexpected number of Discarded Pending Executions, you might want to check whether any of its Trigger Conditions are causing the program to run more frequently than expected (see Define the Run Settings of a Python Program). You might also want to check the program code of the Python program (see Write and Edit the Program Code in a Python Program). For information about other checks you might want to make if a Python program has an unexpectedly high Run Count, see the Run Count entry above.
You can reset the statistics counts by using the Reset All option. You can access this option in a context-sensitive menu by right-clicking on an entry in the list. This resets the statistics counts for all Python programs that the Geo SCADA Expert server is configured to execute. This includes the counts that appear on other displays, such as the Longest Running category of the Server Status Tool.
If you only want to reset the statistics counts for one particular Python program, you can do so via the Reset Counts pick action. Use ViewX to access this pick action for the relevant Python Program item.
The counts reset automatically on system restart and when the driver is restarted. If the Reset counters option is enabled in the Snapshots section of the Server Configuration tool, the counts also reset automatically as part of the statistics counts reset that occurs after each server snapshot is logged. For more information about this latter option, see Server Snapshot Log Files.
Further Information
Define the Maximum Number of Diagnostic Rows that are Shown for Python Programs in the Server Status Tool: see Define the Program Limits on the Server in the Geo SCADA Expert Guide to the Python Driver.