DB2 Version 10.1 for Linux, UNIX, and Windows

WLM_GET_WORKLOAD_STATS table function - Return workload statistics

The WLM_GET_WORKLOAD_STATS function returns one row of workload statistics for every combination of workload name and database member number.

Refer to Table 1 for a complete list of information that can be returned.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-WLM_GET_WORKLOAD_STATS--(--workload_name--,--member--)------><

The schema is SYSPROC.

Table function parameters

workload_name
An input argument of type VARCHAR(128) that specifies a workload for which the statistics are to be returned. If the argument is NULL or an empty string, statistics are returned for all workloads.
member
An input argument of type INTEGER that specifies the number of a member in the same instance as the currently connected database. Specify -1 for the current member, or -2 for all members. If a null value is specified, -1 is set implicitly.

Authorization

One of the following authorities is required to execute the routine:
  • EXECUTE privilege on the routine
  • DATAACCESS authority
  • DBADM authority
  • SQLADM authority
  • WLMADM authority

Default PUBLIC privilege

None

Example

The following query displays statistics for workloads:
SELECT SUBSTR(WORKLOAD_NAME,1,18) AS WL_DEF_NAME,
       SUBSTR(CHAR(MEMBER),1,4) AS MEMB,
       COORD_ACT_LIFETIME_TOP,
       COORD_ACT_LIFETIME_AVG,
       COORD_ACT_LIFETIME_STDDEV
FROM TABLE(WLM_GET_WORKLOAD_STATS(CAST(NULL AS VARCHAR(128)), -2)) AS WLSTATS
ORDER BY WL_DEF_NAME, MEMB
Sample output from the query is as follows:
WL_DEF_NAME        MEMB COORD_ACT_LIFETIME_TOP ...
------------------ ---- ---------------------- ...
SYSDEFAULTADMWORKL 0                        -1 ...
SYSDEFAULTUSERWORK 0                        -1 ...
WL1                0                         2 ...
... COORD_ACT_LIFETIME_AVG   COORD_ACT_LIFETIME_STDDEV
... ------------------------ -------------------------
... -1.00000000000000E+000    -1.00000000000000E+000
... -1.00000000000000E+000    -1.00000000000000E+000
... +2.56000000000000E+000    +6.00000000000001E-002

Usage note

The function does not aggregate data across workloads, members, or service classes. However, you can use SQL queries to aggregate data.

Information returned

Table 1. Information returned by WLM_GET_WORKLOAD_STATS
Column name Data type Description
WORKLOAD_NAME VARCHAR(128) workload_name - Workload name monitor element
DBPARTITIONNUM SMALLINT dbpartitionnum - Database partition number monitor element
LAST_RESET TIMESTAMP last_reset - Last Reset Timestamp monitor element
CONCURRENT_WLO_TOP INTEGER concurrent_wlo_top - Concurrent workload occurrences top monitor element
CONCURRENT_WLO_ACT_TOP INTEGER concurrent_wlo_act_top - Concurrent WLO activity top monitor element
COORD_ACT_COMPLETED_TOTAL BIGINT coord_act_completed_total - Coordinator activities completed total monitor element
COORD_ACT_ABORTED_TOTAL BIGINT coord_act_aborted_total - Coordinator activities aborted total monitor element
COORD_ACT_REJECTED_TOTAL BIGINT coord_act_rejected_total - Coordinator activities rejected total monitor element
WLO_COMPLETED_TOTAL BIGINT wlo_completed_total - Workload occurrences completed total monitor element
COORD_ACT_LIFETIME_TOP BIGINT coord_act_lifetime_top - Coordinator activity lifetime top monitor element
COORD_ACT_LIFETIME_AVG DOUBLE coord_act_lifetime_avg - Coordinator activity lifetime average monitor element
COORD_ACT_LIFETIME_STDDEV DOUBLE Standard deviation of lifetime for completed or aborted coordinator activities at nesting level 0 that are associated with this workload. Units are milliseconds. If the COLLECT AGGREGATE ACTIVITY DATA parameter of the workload is set to NONE, the value of the column is null. This standard deviation is computed from the coordinator activity lifetime histogram and may be inaccurate if the histogram is not correctly sized to fit the data. If any values fall into the last histogram bin, the value -1 is returned.
COORD_ACT_EXEC_TIME_AVG DOUBLE coord_act_exec_time_avg - Coordinator activities execution time average monitor element
COORD_ACT_EXEC_TIME_STDDEV DOUBLE Standard deviation of the execution times for completed or aborted coordinator activities at nesting level 0 that are associated with this workload. Units are milliseconds. This standard deviation is computed from the coordinator activity executetime histogram and may be inaccurate if the histogram is not correctly sized to fit the data. If any values fall into the last histogram bin, the value -1 is returned. If the COLLECT AGGREGATE ACTIVITY DATA parameter of the workload is set to NONE, the value of the column is null.
COORD_ACT_QUEUE_TIME_AVG DOUBLE coord_act_queue_time_avg - Coordinator activity queue time average monitor element
COORD_ACT_QUEUE_TIME_STDDEV DOUBLE Standard deviation of the queue time for completed or aborted coordinator activities at nesting level 0 that are associated with this workload. Units are milliseconds. If the COLLECT AGGREGATE ACTIVITY DATA parameter of the workload is set to NONE, the value of the column is null. This standard deviation is computed from the coordinator activity queuetime histogram and may be inaccurate if the histogram is not correctly sized to fit the data. If any values fall into the last histogram bin, the value -1 is returned.
UOW_TOTAL_TIME_TOP BIGINT uow_total_time_top - UOW total time top monitor element
UOW_THROUGHPUT DOUBLE uow_throughput - Unit of work throughput monitor element
UOW_LIFETIME_AVG DOUBLE uow_lifetime_avg - Unit of work lifetime average monitor element
UOW_COMPLETED_TOTAL BIGINT uow_completed_total - Total completed units of work monitor element
TOTAL_CPU_TIME BIGINT total_cpu_time - Total CPU time monitor element
TOTAL_DISP_RUN_QUEUE_TIME BIGINT total_disp_run_queue_time - Total dispatcher run queue time monitor element
ACT_THROUGHPUT DOUBLE act_throughput - Activity throughput monitor element
CPU_UTILIZATION DOUBLE cpu_utilization - CPU utilization monitor element
APP_ACT_COMPLETED_TOTAL BIGINT app_act_completed_total - Total successful external coordinator activities monitor element
APP_ACT_ABORTED_TOTAL BIGINT app_act_aborted_total - Total failed external coordinator activities monitor element
APP_ACT_REJECTED_TOTAL BIGINT app_act_rejected_total - Total rejected external coordinator activities monitor element
MEMBER SMALLINT member - Database member monitor element