public class PerfWildcardQuery<T extends Enum<T>> extends PerfCounterQuery<T>
| Modifier and Type | Class and Description |
|---|---|
static interface |
PerfWildcardQuery.PdhCounterWildcardProperty
Contract for Counter Property Enums
|
PerfCounterQuery.CounterDataSource, PerfCounterQuery.PdhCounterPropertycounterQuery, NOT_TOTAL_INSTANCE, NOT_TOTAL_INSTANCES, pdhQueryHandler, perfObject, perfWmiClass, propertyEnum, queryKey, source, TOTAL_INSTANCE, TOTAL_INSTANCES, wmiQueryHandler| Constructor and Description |
|---|
PerfWildcardQuery(Class<T> propertyEnum,
String perfObject,
String perfWmiClass)
Construct a new object to hold performance counter data source and results
|
PerfWildcardQuery(Class<T> propertyEnum,
String perfObject,
String perfWmiClass,
String queryKey)
Construct a new object to hold performance counter data source and results
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getInstancesFromLastQuery()
List the instances corresponding to the value map lists
|
protected boolean |
initPdhCounters()
Initialize PDH counters for this data source.
|
Map<T,Long> |
queryValues()
Query the current data source (PDH or WMI) for the Performance Counter values
corresponding to the property enum.
|
Map<T,List<Long>> |
queryValuesWildcard()
Query the current data source (PDH or WMI) for the Performance Counter values
corresponding to the property enum.
|
protected void |
unInitPdhCounters()
Uninitialize PDH counters for this data source.
|
initWmiCounters, setDataSource, unInitWmiCounterspublic PerfWildcardQuery(Class<T> propertyEnum, String perfObject, String perfWmiClass)
propertyEnum - An enum which implements
PerfWildcardQuery.PdhCounterWildcardProperty
and contains the WMI field (Enum value) and PDH Counter string
(instance or counter).
The first element of the enum defines the instance filter, rather than a counter name. This acts as a filter for PDH instances only and should correlate with a WMI String field defining the same name. If the instance is null then all counters will be added to the PDH query, otherwise the PDH counter will only include instances which are wildcard matches with the given instance, replacing '?' with a single character, '*' with any number of characters, and reversing the test if the first character is ^. If the counter source is WMI, the instance filtering has no effect, and it is the responsibility of the user to add filtering to the perfWmiClass string using a WHERE clause.
perfObject - The PDH object for this counter; all counters on this object will
be refreshed at the same timeperfWmiClass - The WMI PerfData_RawData_* class corresponding to the PDH objectpublic PerfWildcardQuery(Class<T> propertyEnum, String perfObject, String perfWmiClass, String queryKey)
propertyEnum - An enum which implements
PerfWildcardQuery.PdhCounterWildcardProperty
and contains the WMI field (Enum value) and PDH Counter string
(instance or counter).
The first element of the enum defines the instance filter, rather than a counter name. This acts as a filter for PDH instances only and should correlate with a WMI String field defining the same name. If the instance is null then all counters will be added to the PDH query, otherwise the PDH counter will only include instances which are wildcard matches with the given instance, replacing '?' with a single character, '*' with any number of characters, and reversing the test if the first character is ^. If the counter source is WMI, the instance filtering has no effect, and it is the responsibility of the user to add filtering to the perfWmiClass string using a WHERE clause.
perfObject - The PDH object for this counter; all counters on this object will
be refreshed at the same timeperfWmiClass - The WMI PerfData_RawData_* class corresponding to the PDH objectqueryKey - An optional key for PDH counter updates; defaults to the PDH
object nameprotected boolean initPdhCounters()
Initialize PDH counters for this data source. Adds necessary counters to a PDH Query.
initPdhCounters in class PerfCounterQuery<T extends Enum<T>>protected void unInitPdhCounters()
Uninitialize PDH counters for this data source. Removes necessary counters from the PDH Query, releasing their handles.
unInitPdhCounters in class PerfCounterQuery<T extends Enum<T>>public Map<T,Long> queryValues()
This method is not implemented on this class.
queryValues in class PerfCounterQuery<T extends Enum<T>>queryValuesWildcard()public Map<T,List<Long>> queryValuesWildcard()
Copyright © 2019. All rights reserved.