Class PerfCounterQueryFFM
java.lang.Object
oshi.util.platform.windows.PerfCounterQueryFFM
Enables queries of Performance Counters using PDH with WMI backup, for enums implementing
PdhCounterProperty.
FFM-based equivalent of PerfCounterQuery.-
Method Summary
Modifier and TypeMethodDescriptionqueryValues(Class<T> propertyEnum, String perfObject, String perfWmiClass) Query Performance Counters using PDH, with WMI backup on failure, for values corresponding to the property enum.queryValuesFromPDH(Class<T> propertyEnum, String perfObject) Query Performance Counters using PDH for values corresponding to the property enum.queryValuesFromWMI(Class<T> propertyEnum, String perfWmiClass) Query Performance Counters using WMI for values corresponding to the property enum.
-
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 ofpropertyEnum- Parameters:
propertyEnum- An enum which implementsPdhCounterPropertyand 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 timeperfWmiClass- The WMI PerfData_RawData_* class corresponding to the PDH object, optionally including a WHERE clause- Returns:
- An
EnumMapof the values indexed bypropertyEnumon 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 ofpropertyEnum- Parameters:
propertyEnum- An enum which implementsPdhCounterPropertyand 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
EnumMapof the values indexed bypropertyEnumon 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 ofpropertyEnum- Parameters:
propertyEnum- An enum which implementsPdhCounterPropertyand 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
EnumMapof the values indexed bypropertyEnumif successful, an empty map if the WMI query failed.
-