Package oshi.util.platform.unix.solaris
Class KstatUtil
java.lang.Object
oshi.util.platform.unix.solaris.KstatUtil
Provides access to kstat information on Solaris
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA copy of the Kstat chain, encapsulating akstat_ctl_tobject. -
Method Summary
Modifier and TypeMethodDescriptionstatic longdataLookupLong(com.sun.jna.platform.unix.solaris.LibKstat.Kstat ksp, String name) Convenience method forLibKstat.kstat_data_lookup(com.sun.jna.platform.unix.solaris.LibKstat.Kstat, java.lang.String)with numeric return values.static StringdataLookupString(com.sun.jna.platform.unix.solaris.LibKstat.Kstat ksp, String name) Convenience method forLibKstat.kstat_data_lookup(com.sun.jna.platform.unix.solaris.LibKstat.Kstat, java.lang.String)with String return values.static KstatUtil.KstatChainCreate a copy of the Kstat chain and lock it for use by this object.
-
Method Details
-
openChain
Create a copy of the Kstat chain and lock it for use by this object.- Returns:
- A locked copy of the chain. It should be unlocked/released when you
are done with it with
KstatUtil.KstatChain.close().
-
dataLookupString
public static String dataLookupString(com.sun.jna.platform.unix.solaris.LibKstat.Kstat ksp, String name) Convenience method forLibKstat.kstat_data_lookup(com.sun.jna.platform.unix.solaris.LibKstat.Kstat, java.lang.String)with String return values. Searches the kstat's data section for the record with the specified name. This operation is valid only for kstat types which have named data records. Currently, only the KSTAT_TYPE_NAMED and KSTAT_TYPE_TIMER kstats have named data records.- Parameters:
ksp- The kstat to searchname- The key for the name-value pair, or name of the timer as applicable- Returns:
- The value as a String.
-
dataLookupLong
public static long dataLookupLong(com.sun.jna.platform.unix.solaris.LibKstat.Kstat ksp, String name) Convenience method forLibKstat.kstat_data_lookup(com.sun.jna.platform.unix.solaris.LibKstat.Kstat, java.lang.String)with numeric return values. Searches the kstat's data section for the record with the specified name. This operation is valid only for kstat types which have named data records. Currently, only the KSTAT_TYPE_NAMED and KSTAT_TYPE_TIMER kstats have named data records.- Parameters:
ksp- The kstat to searchname- The key for the name-value pair, or name of the timer as applicable- Returns:
- The value as a long. If the data type is a character or string type, returns 0 and logs an error.
-