Class PerfCounter
java.lang.Object
oshi.driver.common.windows.perfmon.PerfCounter
Encapsulates the three string components of a PDH performance counter path, plus whether it refers to the base
(SecondValue) of a multi-value counter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSuffix appended to counter names in enum definitions to indicate that the SecondValue (base) should be read instead of the FirstValue. -
Constructor Summary
ConstructorsConstructorDescriptionPerfCounter(String objectName, String instanceName, String counterName) Creates a PerfCounter. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the PDH counter name.Returns the path for this counterGets the PDH instance name.Gets the PDH object name.inthashCode()static booleanTests whether a counter name has theBASE_SUFFIX.booleanChecks whether this is a base (SecondValue) counter.static StringstripBaseSuffix(String counterName) Strips theBASE_SUFFIXfrom a counter name if present.
-
Field Details
-
BASE_SUFFIX
Suffix appended to counter names in enum definitions to indicate that the SecondValue (base) should be read instead of the FirstValue.- See Also:
-
-
Constructor Details
-
PerfCounter
-
-
Method Details
-
getObject
-
getInstance
-
getCounter
-
isBaseCounter
public boolean isBaseCounter()Checks whether this is a base (SecondValue) counter.- Returns:
- Returns whether the counter is a base counter
-
getCounterPath
Returns the path for this counter- Returns:
- A string representing the counter path
-
stripBaseSuffix
Strips theBASE_SUFFIXfrom a counter name if present.- Parameters:
counterName- The counter name, possibly ending with_Base- Returns:
- The counter name without the
_Basesuffix, or the original name if the suffix is not present
-
isBase
Tests whether a counter name has theBASE_SUFFIX.- Parameters:
counterName- The counter name to test- Returns:
- true if the counter name ends with
_Base
-
equals
-
hashCode
-