{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":38499,"path":"platform-administration/c_StatsToolsDiagnosticsPlugin.md","title":"Stats Tools","bundle":null,"doc_type":null,"release":"australia","body":"\n# Stats Tools\n\nTo aid in performance evaluation, the Stats Tools records statistics for system activities that affect performance such as the execution of queries, scripts, and transactions.\n\n**Note:** The Stats Tools plugin is activated by default. It requires the admin role to activate or upgrade, and it requires the com.snc.jrobin.\n\nStats Tools adds modules under **System Diagnostics** &gt; **Stats**, including **Slow Queries**, **Slow Scripts**, and **Slow Transactions**. Each module accesses a table of activity patterns \\[sys\\_query\\_pattern\\], \\[sys\\_script\\_pattern\\], \\[sys\\_transaction\\_pattern\\]. Each pattern table represents a collection of unique activities. Each collection is an aggregation of executions of that unique activity over all time. Each record provides basic timing analysis with example identifiable details of the activity.\n\n**Note:** To aid in debugging, you can filter most of these logs by application scope, limiting the transactions \\(for example, slow scripts or events\\) to only those transactions originating in specific scopes.\n\nActivity patterns are immediately recorded to a cache and are later persisted to their pattern table. If you flush server caches, then recorded activities that have not been persisted are cleared. The following are examples of pattern records.\n\n-   Each time a query is executed that meets the recording and persistence threshold it is aggregated and stored as a query pattern record.\n-   Each time a particular business rule is executed it aggregates to a script pattern record.\n-   Each time a particular background job runs it aggregates into a unique transaction pattern record.\n-   Each click of the **New** button on the Incidents list counts as a list type transaction pattern with specific form action.\n\n## Metrics\n\nMetrics include total and average times of interest per unique execution pattern over the total execution count. Metrics are aggregated with each new instance of the unique activity and persisted to the pattern record.\n\n## Metadata\n\nExample data from specific executions are included on each pattern to identify execution details.\n\n## Characterizations of each activity type\n\n<table id=\"simpletable_yyk_115_jt\"><tbody><tr><td>\n\nTransactions\n\n</td><td>\n\nAny transaction type includes server-side and related client-side transactions.\n\n Metrics include **Total server load time**, which aggregates the total server-side time excluding semaphore and session wait times. It also aggregates relevant server transaction times that are found on the syslog\\_transaction table.\n\n Transaction types:\n\n -   An HTTP Request transaction is identified by a URL, transaction type, processor, form/list action, URL query \\(filters\\), and related table name.\n-   Any other transaction is identified by its transaction URL/page/name, transaction type, and processor or thread name.\n\n</td></tr><tr><td>\n\nScripts\n\n</td><td>\n\nAny script activity type includes scripts evaluated by GlideScopedEvaluator.\n\n Script Types:\n\n -   A Jelly Script is identified by the sys\\_jelly\\_file table, jelly file path, line number, and script that was executed.\n-   Any other script is identified by the table and sys\\_id.\n\n</td></tr><tr><td>\n\nQueries\n\n</td><td>\n\nAny query activity includes prepared statements executed by GlideDBI.\n\n Query Types:\n\n All queries are identified by MongoDB query or insert, update, or select statements, as well as other components of the statement like selected columns, where clause, unions, column sets, and limits.\n\n</td></tr></tbody>\n</table>"}}