Class HkeyPerformanceDataUtilFFM
java.lang.Object
oshi.driver.common.windows.registry.HkeyPerformanceDataUtil
oshi.driver.windows.registry.HkeyPerformanceDataUtilFFM
@ThreadSafe
public final class HkeyPerformanceDataUtilFFM
extends oshi.driver.common.windows.registry.HkeyPerformanceDataUtil
Utility to read HKEY_PERFORMANCE_DATA information using the FFM API.
-
Field Summary
Fields inherited from class oshi.driver.common.windows.registry.HkeyPerformanceDataUtil
COUNTER, HKEY_PERFORMANCE_TEXT -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetCounterIndex(String name) Looks up the performance counter index for the given English counter name.static <T extends Enum<T> & oshi.driver.common.windows.perfmon.PdhCounterWildcardProperty>
oshi.util.tuples.Triplet<List<Map<T, Object>>, Long, Long> readPerfDataFromRegistry(String objectName, Class<T> counterEnum) Reads and parses a block of performance data from the registry.Methods inherited from class oshi.driver.common.windows.registry.HkeyPerformanceDataUtil
buildCounterIndexMap, getCounterIndices
-
Method Details
-
getCounterIndex
Looks up the performance counter index for the given English counter name.- Parameters:
name- The English counter name- Returns:
- The counter index, or 0 if not found
-
readPerfDataFromRegistry
public static <T extends Enum<T> & oshi.driver.common.windows.perfmon.PdhCounterWildcardProperty> oshi.util.tuples.Triplet<List<Map<T,Object>>, Long, Long> readPerfDataFromRegistry(String objectName, Class<T> counterEnum) Reads and parses a block of performance data from the registry.- Type Parameters:
T- PDH Counters use an Enum to identify the fields to query in either the counter or WMI backup, and use the enum values as keys to retrieve the results.- Parameters:
objectName- The counter object for which to fetch datacounterEnum- Which counters to return data for- Returns:
- A triplet containing the results. The first element maps the input enum to the counter values where the
first enum will contain the instance name as a
String, and the remaining values will either beLong,Integer, ornulldepending on whether the specified enum counter was present and the size of the counter value. The second element is a timestamp in 100nSec increments (Windows 1601 Epoch) while the third element is a timestamp in milliseconds since the 1970 Epoch.
-