Class HkeyPerformanceDataUtil

java.lang.Object
oshi.driver.windows.registry.HkeyPerformanceDataUtil

@ThreadSafe
public final class HkeyPerformanceDataUtil
extends java.lang.Object
Utility to read HKEY_PERFORMANCE_DATA information.
  • Method Summary

    Modifier and Type Method Description
    static <T extends java.lang.Enum<T> & PerfCounterWildcardQuery.PdhCounterWildcardProperty>
    Triplet<java.util.List<java.util.Map<T,​java.lang.Object>>,​java.lang.Long,​java.lang.Long>
    readPerfDataFromRegistry​(java.lang.String objectName, java.lang.Class<T> counterEnum)
    Reads and parses a block of performance data from the registry.

    Methods inherited from class java.lang.Object

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

    • readPerfDataFromRegistry

      public static <T extends java.lang.Enum<T> & PerfCounterWildcardQuery.PdhCounterWildcardProperty> Triplet<java.util.List<java.util.Map<T,​java.lang.Object>>,​java.lang.Long,​java.lang.Long> readPerfDataFromRegistry​(java.lang.String objectName, java.lang.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 data
      counterEnum - 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 be Long, Integer, or null depending 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.