public class IPerformanceCollector extends IUnknown
getMetrics(List,List)
.
Metric data is collected at the specified intervals and is retained
internally. The interval and the number of retained samples can be set
withsetupMetrics(List,List,Long,Long)
. Both metric data
and collection settings are not persistent, they are discarded as soon as
VBoxSVC process terminates. Moreover, metric settings and data associated
with a particular VM only exist while VM is running. They disappear as
soon as VM shuts down. It is not possible to set up metrics for machines
that are powered off. One needs to start VM first, then set up metric
collection parameters.
Metrics are organized hierarchically, with each level separated by a
slash (/) character. Generally, the scheme for metric names is like this:Category/Metric[/SubMetric][:aggregation]"Category/Metric" together form the base metric name. A base metric is
the smallest unit for which a sampling interval and the number of
retained samples can be set. Only base metrics can be enabled and
disabled. All sub-metrics are collected when their base metric is
collected. Collected values for any set of sub-metrics can be queried
withqueryMetricsData(List,List,Holder,Holder,Holder,Holder,Holder,Holder,Holder)
.
For example "CPU/Load/User:avg" metric name stands for the "CPU"
category, "Load" metric, "User" submetric, "average" aggregate. An
aggregate function is computed over all retained data. Valid aggregate
functions are:IVirtualBox.getPerformanceCollector()
setupMetrics(List,List,Long,Long)
. From now on
the metric data will be collected and stored.queryMetricsData(List,List,Holder,Holder,Holder,Holder,Holder,Holder,Holder)
. The data
that have been collected so far are returned. Note that the values
are still retained internally and data collection continues.Constructor and Description |
---|
IPerformanceCollector(java.lang.String wrapped,
org.virtualbox_6_0.ObjectRefManager objMgr,
org.virtualbox_6_0.jaxws.VboxPortType port) |
Modifier and Type | Method and Description |
---|---|
java.util.List<IPerformanceMetric> |
disableMetrics(java.util.List<java.lang.String> metricNames,
java.util.List<IUnknown> objects)
Turns off collecting specified base metrics.
|
java.util.List<IPerformanceMetric> |
enableMetrics(java.util.List<java.lang.String> metricNames,
java.util.List<IUnknown> objects)
Turns on collecting specified base metrics.
|
java.util.List<java.lang.String> |
getMetricNames()
Array of unique names of metrics.
|
java.util.List<IPerformanceMetric> |
getMetrics(java.util.List<java.lang.String> metricNames,
java.util.List<IUnknown> objects)
Returns parameters of specified metrics for a set of objects.
|
static IPerformanceCollector |
queryInterface(IUnknown obj) |
java.util.List<java.lang.Integer> |
queryMetricsData(java.util.List<java.lang.String> metricNames,
java.util.List<IUnknown> objects,
Holder<java.util.List<java.lang.String>> returnMetricNames,
Holder<java.util.List<IUnknown>> returnObjects,
Holder<java.util.List<java.lang.String>> returnUnits,
Holder<java.util.List<java.lang.Long>> returnScales,
Holder<java.util.List<java.lang.Long>> returnSequenceNumbers,
Holder<java.util.List<java.lang.Long>> returnDataIndices,
Holder<java.util.List<java.lang.Long>> returnDataLengths)
Queries collected metrics data for a set of objects.
|
java.util.List<IPerformanceMetric> |
setupMetrics(java.util.List<java.lang.String> metricNames,
java.util.List<IUnknown> objects,
java.lang.Long period,
java.lang.Long count)
Sets parameters of specified base metrics for a set of objects.
|
getObjMgr, getRemoteWSPort, getWrapped, releaseRemote
public IPerformanceCollector(java.lang.String wrapped, org.virtualbox_6_0.ObjectRefManager objMgr, org.virtualbox_6_0.jaxws.VboxPortType port)
public java.util.List<java.lang.String> getMetricNames()
getMetrics(List,List)
can be used to get the
list of supported metrics for a particular object.public static IPerformanceCollector queryInterface(IUnknown obj)
public java.util.List<IPerformanceMetric> getMetrics(java.util.List<java.lang.String> metricNames, java.util.List<IUnknown> objects)
metricNames
- Metric name filter. Currently, only a comma-separated list of metrics
is supported.objects
- Set of objects to return metric parameters for.public java.util.List<IPerformanceMetric> setupMetrics(java.util.List<java.lang.String> metricNames, java.util.List<IUnknown> objects, java.lang.Long period, java.lang.Long count)
IPerformanceMetric
describing the metrics
have been affected.metricNames
- Metric name filter. Comma-separated list of metrics with wildcard
support.objects
- Set of objects to setup metric parameters for.period
- Time interval in seconds between two consecutive samples of
performance data.count
- Number of samples to retain in performance data history. Older
samples get discarded.public java.util.List<IPerformanceMetric> enableMetrics(java.util.List<java.lang.String> metricNames, java.util.List<IUnknown> objects)
IPerformanceMetric
describing the metrics have been
affected.metricNames
- Metric name filter. Comma-separated list of metrics with wildcard
support.objects
- Set of objects to enable metrics for.public java.util.List<IPerformanceMetric> disableMetrics(java.util.List<java.lang.String> metricNames, java.util.List<IUnknown> objects)
IPerformanceMetric
describing the metrics have been
affected.metricNames
- Metric name filter. Comma-separated list of metrics with wildcard
support.objects
- Set of objects to disable metrics for.public java.util.List<java.lang.Integer> queryMetricsData(java.util.List<java.lang.String> metricNames, java.util.List<IUnknown> objects, Holder<java.util.List<java.lang.String>> returnMetricNames, Holder<java.util.List<IUnknown>> returnObjects, Holder<java.util.List<java.lang.String>> returnUnits, Holder<java.util.List<java.lang.Long>> returnScales, Holder<java.util.List<java.lang.Long>> returnSequenceNumbers, Holder<java.util.List<java.lang.Long>> returnDataIndices, Holder<java.util.List<java.lang.Long>> returnDataLengths)
metricNames
- Metric name filter. Comma-separated list of metrics with wildcard
support.objects
- Set of objects to query metrics for.returnMetricNames
- Names of metrics returned in returnData.returnObjects
- Objects associated with metrics returned in returnData.returnUnits
- Units of measurement for each returned metric.returnScales
- Divisor that should be applied to return values in order to get
floating point values. For example:(double)returnData[returnDataIndices[0]+i] / returnScales[0]will retrieve the floating point value of i-th sample of the first
metric.returnSequenceNumbers
- Sequence numbers of the first elements of value sequences of
particular metrics returned in returnData. For aggregate metrics
it is the sequence number of the sample the aggregate started
calculation from.returnDataIndices
- Indices of the first elements of value sequences of particular
metrics returned in returnData.returnDataLengths
- Lengths of value sequences of particular metrics.