Statistics event monitoring
The statistics event monitor captures data that can be used to measure different aspects of system operation.
- Metrics
- Metrics are request monitor elements that capture measurement information about the system. These metrics include time-spent monitor elements like the time waited on locks and counter monitor elements like the number of deadlocks that occurred. Collection of these metrics can be configured for the entire database with the mon_req_metrics database configuration parameter, or for specific service classes through the COLLECT REQUEST METRICS clause of CREATE or ALTER SERVICE CLASS statements. Some system metrics are collected as part of the details_xml and metrics monitor elements in the EVENT_SCSTATS and EVENT_WLSTATS logical data groups. Both these monitor elements are XML documents.
- Statistics
- Statistics are maintained for workload manager objects. Workload manager objects include service classes, work classes, workloads, and threshold queues. These statistics include high watermark monitor elements like temporary table space usage and calculated monitor elements like estimated cost averages. The statistics reside in memory and can be viewed in real time by using workload manager statistics table functions. Alternatively, or the statistics can be collected and sent to a statistics event monitor where they can be viewed later for historical analysis. By default, a minimal set of statistics is collected for each workload manager object. You can modify the scope of statistics collection by using the clauses in the CREATE or ALTER statements for the various workload manager objects.
The XML documents in the details_xml and metrics monitor elements contain the same metrics with one important difference. The metrics in details_xml generally start at 0 and continue to accumulate until the next database activation, while the metrics in metrics are calculated to show the change in value for the metric since the last time statistics were collected. The schema for the XML documents returned is available in the file sqllib/misc/DB2MonCommon.xsd. The top-level element is system_metrics.
In addition to viewing system metrics from the XML document in the metrics monitor element, you can also view the individual metrics directly from the output associated with the EVENT_SCMETRICS and EVENT_WLMETRICS logical data groups.
The metrics collected by the statistics event monitor are the same set of metrics that are reported by the MON_GET_SERVICE_SUBCLASS_DETAILS and MON_GET_WORKLOAD_DETAILS table functions. The XML document in the DETAILS column of the tables returned by these two table functions contain many other monitor elements in addition to the system metrics monitor elements.
System metrics monitor elements are only collected for a request if the request is processed by an agent in a service subclass whose parent service superclass has request monitor element collection enabled, or if system metrics collection is enabled for the entire database. If system metrics collection is disabled at the database level, as well as for a service superclass, the metrics reported in the details_xml document stop increasing (or remain at 0 if request metrics were disabled at database activation time).