Class QueryContention

java.lang.Object
com.ibm.jzos.wlm.QueryContention

public class QueryContention extends Object

A wrapper for z/OS SYSEVENT QRYCONT.

For more information on SYSEVENT QRYCONT, please refer to "z/OS MVS Authorized Assembler Services Reference SET-WTO" and "z/OS MVS Diagnosis: Reference".

Query resource contentions in an address space. The query can be performed to request contentions of all types, or limited only to standard/shortime enqueue holds or chronic resource contentions.

Usage examples:

  1. Query resource contentions of all types in current address space. A QueryContentionResult object is returned as a result of the query.
    QueryContentionResult result = QueryContention.query();
         
  2. Query resource contentions of all types in a specific address space, for example, asid 0050 in hex values.
    byte[] asid = new byte[] { (byte)0x00, (byte)0x50};
    QueryContentionResult result = QueryContention.query(asid);
         
  3. Query chronic resource contentions only in current address space.
    QueryContentionResult result = queryContention.query(QueryContention.REQTYPE_CHRONIC_CONTENTIONS);
         
  4. Retrieve information from the QueryContentionResult object returned from a query.
         
    ResourceContention[] resourceContentions = 
                      result.getResourceContentions();           // The list of contentions returned from the query 
    int numContentions = result.getNumberOfContentions();        // Number of contentions in the list
    boolean additionalContentions = result.hasMoreContentions(); // Are there additional contentions other than those returned?
         
  5. Traverse the contentions list for information about each contention.
         
    for (int i = 0; i invalid input: '<' resourceContentions.length; i++) {     
         ResourceContention contention = resourceContentions[i];
         String subsystemType = contention.getSubsystemType();
         String subsystemName = contention.getSubsystemName();
         byte[] startTime = contention.getStartTime();
         int contentionID = contention.getContentionId();
         int count = contention.getCount();
    }
         

Since:
2.4.5
See Also:
  • Field Details

    • REQTYPE_ALL

      public static final int REQTYPE_ALL
      Request contentions of all types.
      See Also:
    • REQTYPE_ENQHOLDS

      public static final int REQTYPE_ENQHOLDS
      Request only short time/standard enqueue holds.
      See Also:
    • REQTYPE_CHRONIC_CONTENTIONS

      public static final int REQTYPE_CHRONIC_CONTENTIONS
      Request only chronic resource contentions.
      See Also:
  • Method Details

    • query

      Query contentions of all types in the current address space.
      Returns:
      query result
      Throws:
      RcException - if an error is encountered. See the class comment and the SYSEVENT QRYCONT documentation for more information on how to interpret the error information.
      UnsupportedOperationException - if SYSEVENT QRYCONT is not supported by the z/OS release on the system
    • query

      public static QueryContentionResult query(int requestType) throws RcException, UnsupportedOperationException
      Query contentions of a particular type in the current address space.
      Parameters:
      requestType - request contentions of the requestType. Valid types are:
      • REQTYPE_ALL, requesting contentions of all types. Default if requestType is not provided
      • REQTYPE_ENQHOLDS, requesting only short time/standard enqueue holds
      • REQTYPE_CHRONIC_CONTENTIONS, requesting only chronic resource contentions
      Returns:
      query result
      Throws:
      IllegalArgumentException - if an invalid requestType
      RcException - if an error is encountered. See the class comment and the SYSEVENT QRYCONT documentation for more information on how to interpret the error information.
      UnsupportedOperationException - if SYSEVENT QRYCONT is not supported by the z/OS release on the system
    • query

      public static QueryContentionResult query(byte[] asid) throws RcException, UnsupportedOperationException
      Query contentions of all types in an address space.
      Parameters:
      asid - two-byte address space identifier in hex values
      Returns:
      query result
      Throws:
      IllegalArgumentException - if invalid asid byte length
      RcException - if an error is encountered. See the class comment and the SYSEVENT QRYCONT documentation for more information on how to interpret the error information.
      UnsupportedOperationException - if SYSEVENT QRYCONT is not supported by the z/OS release on the system
    • query

      public static QueryContentionResult query(int requestType, byte[] asid) throws RcException, UnsupportedOperationException
      Query contentions of a particular type in an address space.
      Parameters:
      requestType - request contentions of the requestType. Valid types are:
      • REQTYPE_ALL, requesting contentions of all types. Default if requestType is not provided
      • REQTYPE_ENQHOLDS, requesting only short time/standard enqueue holds
      • REQTYPE_CHRONIC_CONTENTIONS, requesting only chronic resource contentions
      asid - two-byte address space identifier in hex values
      Returns:
      query result
      Throws:
      IllegalArgumentException - if an invalid requestType
      IllegalArgumentException - if invalid asid byte length
      RcException - if an error is encountered. See the class comment and the SYSEVENT QRYCONT documentation for more information on how to interpret the error information.
      UnsupportedOperationException - if SYSEVENT QRYCONT is not supported by the z/OS release on the system