Class PerfCounterQueryExecutorJNA
java.lang.Object
oshi.driver.windows.perfmon.PerfCounterQueryExecutorJNA
- All Implemented Interfaces:
PerfCounterQueryExecutor
JNA-based
PerfCounterQueryExecutor implementation.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the disk performance counters are disabled.booleanReturns whether the OS performance counters are disabled.booleanReturns whether the process performance counters are disabled.booleanReturns whether the OS is Windows 7 or greater.queryInstancesAndValues(Class<T> propertyEnum, String perfObject, String perfWmiClass) Queries performance counter values for wildcard (multi-instance) counters.queryInstancesAndValues(Class<T> propertyEnum, String perfObject, String perfWmiClass, String customFilter) Queries performance counter values for wildcard counters with a custom instance filter.queryInstancesAndValuesFromPDH(Class<T> propertyEnum, String perfObject) Queries performance counter values from PDH only (no WMI fallback).queryInstancesAndValuesFromWMI(Class<T> propertyEnum, String perfWmiClass) Queries performance counter values from WMI directly (formatted/cooked data).<T extends Enum<T> & PdhCounterProperty>
Map<T, Long> queryValues(Class<T> propertyEnum, String perfObject, String perfWmiClass) Queries performance counter values for a fixed set of counters.
-
Field Details
-
INSTANCE
Singleton instance.
-
-
Method Details
-
queryValues
public <T extends Enum<T> & PdhCounterProperty> Map<T,Long> queryValues(Class<T> propertyEnum, String perfObject, String perfWmiClass) Description copied from interface:PerfCounterQueryExecutorQueries performance counter values for a fixed set of counters.- Specified by:
queryValuesin interfacePerfCounterQueryExecutor- Type Parameters:
T- the enum type implementingPdhCounterProperty- Parameters:
propertyEnum- the property enum classperfObject- the performance object nameperfWmiClass- the WMI class name for fallback queries- Returns:
- a map of enum constants to their counter values, or an empty map if disabled
-
queryInstancesAndValues
public <T extends Enum<T> & PdhCounterWildcardProperty> Pair<List<String>, Map<T, List<Long>>> queryInstancesAndValues(Class<T> propertyEnum, String perfObject, String perfWmiClass) Description copied from interface:PerfCounterQueryExecutorQueries performance counter values for wildcard (multi-instance) counters.- Specified by:
queryInstancesAndValuesin interfacePerfCounterQueryExecutor- Type Parameters:
T- the enum type implementingPdhCounterWildcardProperty- Parameters:
propertyEnum- the property enum classperfObject- the performance object nameperfWmiClass- the WMI class name for fallback queries- Returns:
- a pair of instance names and a map of enum constants to lists of values, or empty if disabled
-
queryInstancesAndValues
public <T extends Enum<T> & PdhCounterWildcardProperty> Pair<List<String>, Map<T, List<Long>>> queryInstancesAndValues(Class<T> propertyEnum, String perfObject, String perfWmiClass, String customFilter) Description copied from interface:PerfCounterQueryExecutorQueries performance counter values for wildcard counters with a custom instance filter.- Specified by:
queryInstancesAndValuesin interfacePerfCounterQueryExecutor- Type Parameters:
T- the enum type implementingPdhCounterWildcardProperty- Parameters:
propertyEnum- the property enum classperfObject- the performance object nameperfWmiClass- the WMI class name for fallback queriescustomFilter- custom PDH instance filter- Returns:
- a pair of instance names and a map of enum constants to lists of values, or empty if disabled
-
queryInstancesAndValuesFromWMI
public <T extends Enum<T> & PdhCounterWildcardProperty> Pair<List<String>, Map<T, List<Long>>> queryInstancesAndValuesFromWMI(Class<T> propertyEnum, String perfWmiClass) Description copied from interface:PerfCounterQueryExecutorQueries performance counter values from WMI directly (formatted/cooked data).- Specified by:
queryInstancesAndValuesFromWMIin interfacePerfCounterQueryExecutor- Type Parameters:
T- the enum type implementingPdhCounterWildcardProperty- Parameters:
propertyEnum- the property enum classperfWmiClass- the WMI class name- Returns:
- a pair of instance names and a map of enum constants to lists of values, or empty if disabled
-
queryInstancesAndValuesFromPDH
public <T extends Enum<T> & PdhCounterWildcardProperty> Pair<List<String>, Map<T, List<Long>>> queryInstancesAndValuesFromPDH(Class<T> propertyEnum, String perfObject) Description copied from interface:PerfCounterQueryExecutorQueries performance counter values from PDH only (no WMI fallback).- Specified by:
queryInstancesAndValuesFromPDHin interfacePerfCounterQueryExecutor- Type Parameters:
T- the enum type implementingPdhCounterWildcardProperty- Parameters:
propertyEnum- the property enum classperfObject- the performance object name- Returns:
- a pair of instance names and a map of enum constants to lists of values
-
isPerfOsDisabled
public boolean isPerfOsDisabled()Description copied from interface:PerfCounterQueryExecutorReturns whether the OS performance counters are disabled.- Specified by:
isPerfOsDisabledin interfacePerfCounterQueryExecutor- Returns:
- true if PerfOS counters are disabled
-
isPerfProcDisabled
public boolean isPerfProcDisabled()Description copied from interface:PerfCounterQueryExecutorReturns whether the process performance counters are disabled.- Specified by:
isPerfProcDisabledin interfacePerfCounterQueryExecutor- Returns:
- true if PerfProc counters are disabled
-
isPerfDiskDisabled
public boolean isPerfDiskDisabled()Description copied from interface:PerfCounterQueryExecutorReturns whether the disk performance counters are disabled.- Specified by:
isPerfDiskDisabledin interfacePerfCounterQueryExecutor- Returns:
- true if PerfDisk counters are disabled
-
isWin7OrGreater
public boolean isWin7OrGreater()Description copied from interface:PerfCounterQueryExecutorReturns whether the OS is Windows 7 or greater.- Specified by:
isWin7OrGreaterin interfacePerfCounterQueryExecutor- Returns:
- true if Windows 7+
-