org.virtualbox_5_2
Class IPerformanceCollector

java.lang.Object
  extended by org.virtualbox_5_2.IUnknown
      extended by org.virtualbox_5_2.IPerformanceCollector

public class IPerformanceCollector
extends IUnknown

The IPerformanceCollector interface represents a service that collects and stores performance metrics data. Performance metrics are associated with objects of interfaces like IHost and IMachine. Each object has a distinct set of performance metrics. The set can be obtained withgetMetrics(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:

When setting up metric parameters, querying metric data, enabling or disabling metrics wildcards can be used in metric names to specify a subset of metrics. For example, to select all CPU-related metrics useCPU/*, all averages can be queried using*:avgand so on. To query metric values without aggregates*:can be used. The valid names for base metrics are:The general sequence for collecting and retrieving the metrics is:For an example of usage refer to the following files in VirtualBox SDK: Interface ID: {B14290AD-CD54-400C-B858-797BCB82570E}


Field Summary
 
Fields inherited from class org.virtualbox_5_2.IUnknown
obj, objMgr, port
 
Constructor Summary
IPerformanceCollector(java.lang.String wrapped, org.virtualbox_5_2.ObjectRefManager objMgr, org.virtualbox_5_2.jaxws.VboxPortType port)
           
 
Method Summary
 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.
 
Methods inherited from class org.virtualbox_5_2.IUnknown
getObjMgr, getRemoteWSPort, getWrapped, releaseRemote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IPerformanceCollector

public IPerformanceCollector(java.lang.String wrapped,
                             org.virtualbox_5_2.ObjectRefManager objMgr,
                             org.virtualbox_5_2.jaxws.VboxPortType port)
Method Detail

getMetricNames

public java.util.List<java.lang.String> getMetricNames()
Array of unique names of metrics. This array represents all metrics supported by the performance collector. Individual objects do not necessarily support all of them.getMetrics(List,List)can be used to get the list of supported metrics for a particular object.

Returns:
List<String>

queryInterface

public static IPerformanceCollector queryInterface(IUnknown obj)

getMetrics

public 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.

Parameters:
metricNames - Metric name filter. Currently, only a comma-separated list of metrics is supported.
objects - Set of objects to return metric parameters for.
Returns:
Array of returned metric parameters. NOTE: Null metrics array means all metrics. Null object array means all existing objects.

setupMetrics

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)
Sets parameters of specified base metrics for a set of objects. Returns an array ofIPerformanceMetricdescribing the metrics have been affected.

Parameters:
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.
Returns:
Array of metrics that have been modified by the call to this method. NOTE: Null or empty metric name array means all metrics. Null or empty object array means all existing objects. If metric name array contains a single element and object array contains many, the single metric name array element is applied to each object array element to form metric/object pairs.

enableMetrics

public java.util.List<IPerformanceMetric> enableMetrics(java.util.List<java.lang.String> metricNames,
                                                        java.util.List<IUnknown> objects)
Turns on collecting specified base metrics. Returns an array ofIPerformanceMetricdescribing the metrics have been affected.

Parameters:
metricNames - Metric name filter. Comma-separated list of metrics with wildcard support.
objects - Set of objects to enable metrics for.
Returns:
Array of metrics that have been modified by the call to this method. NOTE: Null or empty metric name array means all metrics. Null or empty object array means all existing objects. If metric name array contains a single element and object array contains many, the single metric name array element is applied to each object array element to form metric/object pairs.

disableMetrics

public java.util.List<IPerformanceMetric> disableMetrics(java.util.List<java.lang.String> metricNames,
                                                         java.util.List<IUnknown> objects)
Turns off collecting specified base metrics. Returns an array ofIPerformanceMetricdescribing the metrics have been affected.

Parameters:
metricNames - Metric name filter. Comma-separated list of metrics with wildcard support.
objects - Set of objects to disable metrics for.
Returns:
Array of metrics that have been modified by the call to this method. NOTE: Null or empty metric name array means all metrics. Null or empty object array means all existing objects. If metric name array contains a single element and object array contains many, the single metric name array element is applied to each object array element to form metric/object pairs.

queryMetricsData

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)
Queries collected metrics data for a set of objects. The data itself and related metric information are returned in seven parallel and one flattened array of arrays. Elements ofreturnMetricNames, returnObjects, returnUnits, returnScales, returnSequenceNumbers, returnDataIndices and returnDataLengthswith the same index describe one set of values corresponding to a single metric. ThereturnDataparameter is a flattened array of arrays. Each start and length of a sub-array is indicated byreturnDataIndicesandreturnDataLengths. The first value for metricmetricNames[i]is atreturnData[returnIndices[i]].

Parameters:
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.
Returns:
Flattened array of all metric data containing sequences of values for each metric. NOTE: Null or empty metric name array means all metrics. Null or empty object array means all existing objects. If metric name array contains a single element and object array contains many, the single metric name array element is applied to each object array element to form metric/object pairs. NOTE: Data collection continues behind the scenes after call to queryMetricsData. The return data can be seen as the snapshot of the current state at the time of queryMetricsData call. The internally kept metric values are not cleared by the call. This allows querying different subsets of metrics or aggregates with subsequent calls. If periodic querying is needed it is highly suggested to query the values with interval*count period to avoid confusion. This way a completely new set of data values will be provided by each query.