Class PerfCounterQueryFFM

java.lang.Object
oshi.util.platform.windows.PerfCounterQueryFFM

@ThreadSafe public final class PerfCounterQueryFFM extends Object
Enables queries of Performance Counters using PDH with WMI backup, for enums implementing PdhCounterProperty. FFM-based equivalent of PerfCounterQuery.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends Enum<T> & oshi.driver.common.windows.perfmon.PdhCounterProperty>
    Map<T,Long>
    queryValues(Class<T> propertyEnum, String perfObject, String perfWmiClass)
    Query Performance Counters using PDH, with WMI backup on failure, for values corresponding to the property enum.
    static <T extends Enum<T> & oshi.driver.common.windows.perfmon.PdhCounterProperty>
    Map<T,Long>
    queryValuesFromPDH(Class<T> propertyEnum, String perfObject)
    Query Performance Counters using PDH for values corresponding to the property enum.
    static <T extends Enum<T> & oshi.driver.common.windows.perfmon.PdhCounterProperty>
    Map<T,Long>
    queryValuesFromWMI(Class<T> propertyEnum, String perfWmiClass)
    Query Performance Counters using WMI for values corresponding to the property enum.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • queryValues

      public static <T extends Enum<T> & oshi.driver.common.windows.perfmon.PdhCounterProperty> Map<T,Long> queryValues(Class<T> propertyEnum, String perfObject, String perfWmiClass)
      Query Performance Counters using PDH, with WMI backup on failure, for values corresponding to the property enum.
      Type Parameters:
      T - The enum type of propertyEnum
      Parameters:
      propertyEnum - An enum which implements PdhCounterProperty and contains the WMI field (Enum value) and PDH Counter string (instance and counter)
      perfObject - The PDH object for this counter; all counters on this object will be refreshed at the same time
      perfWmiClass - The WMI PerfData_RawData_* class corresponding to the PDH object, optionally including a WHERE clause
      Returns:
      An EnumMap of the values indexed by propertyEnum on success, or an empty map if both PDH and WMI queries failed.
    • queryValuesFromPDH

      public static <T extends Enum<T> & oshi.driver.common.windows.perfmon.PdhCounterProperty> Map<T,Long> queryValuesFromPDH(Class<T> propertyEnum, String perfObject)
      Query Performance Counters using PDH for values corresponding to the property enum.
      Type Parameters:
      T - The enum type of propertyEnum
      Parameters:
      propertyEnum - An enum which implements PdhCounterProperty and contains the WMI field (Enum value) and PDH Counter string (instance and counter)
      perfObject - The PDH object for this counter; all counters on this object will be refreshed at the same time
      Returns:
      An EnumMap of the values indexed by propertyEnum on success, or an empty map if the PDH query failed.
    • queryValuesFromWMI

      public static <T extends Enum<T> & oshi.driver.common.windows.perfmon.PdhCounterProperty> Map<T,Long> queryValuesFromWMI(Class<T> propertyEnum, String perfWmiClass)
      Query Performance Counters using WMI for values corresponding to the property enum.
      Type Parameters:
      T - The enum type of propertyEnum
      Parameters:
      propertyEnum - An enum which implements PdhCounterProperty and contains the WMI field (Enum value) and PDH Counter string (instance and counter)
      perfWmiClass - The WMI PerfData_RawData_* class corresponding to the PDH object, optionally including a WHERE clause
      Returns:
      An EnumMap of the values indexed by propertyEnum if successful, an empty map if the WMI query failed.