public class Query extends Object implements Collector
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
attributes
The attribute(s) to retrieve (
MBeanServer.getAttribute(javax.management.ObjectName, String))
If empty, will fetch all attributes of the MBean. |
protected String |
key
If the MBean attribute value is a
CompositeData, the key to lookup. |
protected ObjectName |
objectName |
protected Integer |
position
If the returned value is a
Collectionor an array, the position of the entry to lookup. |
protected String |
resultAlias |
protected ResultNameStrategy |
resultNameStrategy |
| Constructor and Description |
|---|
Query(String objectName,
List<String> attributes,
String key,
Integer position,
String type,
String resultAlias,
ResultNameStrategy resultNameStrategy,
Integer collectInterval)
Creates a query that accepts a list of attributes to collect.
|
Query(String objectName,
String attribute,
int position,
ResultNameStrategy resultNameStrategy) |
Query(String objectName,
String attribute,
ResultNameStrategy resultNameStrategy) |
Query(String objectName,
String attribute,
String key,
Integer position,
String type,
String resultAlias,
ResultNameStrategy resultNameStrategy)
Creates a Query with no collectInterval overide.
|
Query(String objectName,
String attribute,
String key,
Integer position,
String type,
String resultAlias,
ResultNameStrategy resultNameStrategy,
Integer collectInterval) |
Query(String objectName,
String attribute,
String resultAlias,
ResultNameStrategy resultNameStrategy) |
| Modifier and Type | Method and Description |
|---|---|
void |
collectAndExport(MBeanServer mbeanServer,
OutputWriter outputWriter) |
List<String> |
getAttributes() |
Integer |
getCollectIntervalOverrideOrNull() |
String |
getKey() |
ObjectName |
getObjectName() |
Integer |
getPosition() |
String |
getResultAlias() |
String |
getType() |
String |
toString() |
@Nonnull protected ResultNameStrategy resultNameStrategy
@Nonnull protected final ObjectName objectName
@Nonnull protected List<String> attributes
MBeanServer.getAttribute(javax.management.ObjectName, String))
If empty, will fetch all attributes of the MBean.@Nullable protected final String key
CompositeData, the key to lookup.CompositeData.get(String)@Nullable protected final Integer position
Collectionor an array, the position of the entry to lookup.public Query(@Nonnull String objectName, @Nullable String attribute, @Nonnull ResultNameStrategy resultNameStrategy)
public Query(@Nonnull String objectName, @Nullable String attribute, int position, @Nonnull ResultNameStrategy resultNameStrategy)
public Query(@Nonnull String objectName, @Nullable String attribute, @Nullable String resultAlias, @Nonnull ResultNameStrategy resultNameStrategy)
public Query(@Nonnull String objectName, @Nullable String attribute, @Nullable String key, @Nullable Integer position, @Nullable String type, @Nullable String resultAlias, @Nonnull ResultNameStrategy resultNameStrategy)
public Query(@Nonnull String objectName, @Nullable String attribute, @Nullable String key, @Nullable Integer position, @Nullable String type, @Nullable String resultAlias, @Nonnull ResultNameStrategy resultNameStrategy, @Nullable Integer collectInterval)
objectName - The ObjectName to search for
(MBeanServer.queryMBeans(javax.management.ObjectName, javax.management.QueryExp)),
can contain wildcards and return several entries.attribute - The attribute to retrieve (MBeanServer.getAttribute(javax.management.ObjectName, String))key - if the MBean attribute value is a CompositeData, the key to lookup.position - if the returned value is a Collection or an array, the position of the entry to lookup.type - type of the metric ('counter', 'gauge', ...)resultAlias - resultNameStrategy - the ResultNameStrategy used during the
collectAndExport(javax.management.MBeanServer, OutputWriter) phase.public Query(@Nonnull String objectName, @Nonnull List<String> attributes, @Nullable String key, @Nullable Integer position, @Nullable String type, @Nullable String resultAlias, @Nonnull ResultNameStrategy resultNameStrategy, @Nullable Integer collectInterval)
collectInterval - Query(String, String, String, Integer, String, String, ResultNameStrategy)public void collectAndExport(@Nonnull MBeanServer mbeanServer, @Nonnull OutputWriter outputWriter)
collectAndExport in interface Collector@Nonnull public ObjectName getObjectName()
Copyright © 2017. All Rights Reserved.