Purpose:
The Performance Monitor interface.
Performance Monitor is an operator that allows to monitor the performance of Hardware Nodes and Virtuozzo Containers. By monitoring the utilization of the system resources, you can acquire an important information about your system health. Performance Monitor can track a range of processes in real time and provide you with the results that can be used to identify current and potential problems. It can assist you with the tracking of the processes that need to be optimized, monitoring the results of the configuration changes, and identifying the resource usage bottlenecks.
The type of the resource and the aspect of the performance is specified by selecting a class, an instance, and a counter combination. The rest of this section explains what they are. The XML examples at the end of the section demonstrate how to get lists of the available classes and counters.
Performance Class is a type of the system resource that can be monitored, such as CPU, memory, disk, network. A class is identified by ID. You obtain the IDs of the available classes by retrieving them from the Agent vocabulary. Each performance class definition exists as a category in the vocabulary. To distinguish the class categories from other categories, they all belong to another category named counters
. The following is an example of a class definition in the vocabulary:
<category>
<id>counters_net</id>
<category>generic</category>
<category>counters</category>
<short>Network usage</short>
<long>Network usage related parameters</long>
</category>
Class Instance refers to a particular device when multiple devices of the same type exist in the system. For example, your system may have multiple network interfaces or more than one hard disk drive. When monitoring a resource performance, you first have to select the appropriate class. The class alone, however, does not single out a particular resource when more than one device of the same type exist (e.g. multiple network interfaces). In such a case, you must also specify the instance that you would like to monitor. An instance is identified by the name of the device given to it by the operating system. If there's only one instance of a resource, it is not necessary to supply the instance name.
Performance Counters are used to measure various aspects of a performance, such as the CPU times, network rates, disk usage, etc. Each class has its own set of counters. The counter data is comprised of the current, minimum, maximum, and average values. You retrieve the list of counters available for a particular class from the vocabulary by specifying the class name as the criteria. Performance counters are stored as parameters in a vocabulary. Each counter has a category
property that contains the name of the performance class to which this counter belongs. The following is an example of a performance counter entry in a vocabulary.
<parameter>
<id>counter_cpu_system</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>2</counter_type>
<short>System</short>
<long>System CPU time</long>
<measure>seconds</measure>
</parameter>
The following table describes the properties of a performance counter:
Property |
Description |
|
A string containing the unique counter ID. |
|
A string containing the name of the parent performance class (in general, the name of the parent vocabulary category). |
|
A string specifying the data type of the counter values. The possible types are:
|
|
A numeric representation of the counter data type (used internally by Agent). |
|
An integer representing the counter type. Depending on the type, the values of the counter can be interpreted differently:
|
|
Short counter description. |
|
Long counter description. |
|
Units of measure. |
Getting a list of classes from the vocabulary
The following example shows how to retrieve the list of classes from the vocabulary:
Input
<packet version="4.0.0">
<data>
<system>
<get_vocabulary>
<category>counters</category>
</get_vocabulary>
</system>
</data>
</packet>
Output
The output contains two major sections: VZABasicFunctionality
and generic
. If you want to monitor a Virtuozzo Container, use the classes from the VZABasicFunctionality
section. If you want to monitor a Hardware Node, use the classes from the generic
section.
<ns1:packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/system" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="cc45f7f5a6t5af1r4e4" priority="0" version="4.0.0">
<ns1:origin>gend</ns1:origin>
<ns1:target>vzclient8</ns1:target>
<ns1:dst>
<ns1:director>gend</ns1:director>
</ns1:dst>
<ns1:data>
<ns1:system>
<!-- Virtuozzo Containers classes -->
<ns2:vocabulary>
<ns2:name>VZABasicFunctionality</ns2:name>
<ns2:category>
<id>counters_vz_cpu</id>
<category>virtuozzo</category>
<category>counters</category>
<short>CPU usage</short>
<long>VPS CPU related counters</long>
</ns2:category>
<ns2:category>
<id>counters_vz_ubc</id>
<category>virtuozzo</category>
<category>counters</category>
<short>User Bean Counters (UBC)</short>
<long>User Bean Counters (UBC)</long>
</ns2:category>
<ns2:category>
<id>counters_vz_net</id>
<category>virtuozzo</category>
<category>counters</category>
<short>Network usage</short>
<long>VPS Network related counters</long>
</ns2:category>
<ns2:category>
<id>counters_vz_quota</id>
<category>virtuozzo</category>
<category>counters</category>
<short>Quotas</short>
<long>Disk Quota parameters</long>
</ns2:category>
<ns2:category>
<id>counters_vz_loadavg</id>
<category>virtuozzo</category>
<category>counters</category>
<short>Load Average</short>
<long>VPS load avg parameters</long>
</ns2:category>
<ns2:category>
<id>counters_vz_process</id>
<category>virtuozzo</category>
<category>counters</category>
<short>Processes information</short>
<long>Counters of processes in various states</long>
</ns2:category>
<ns2:category>
<id>counters_vz_system</id>
<category>virtuozzo</category>
<category>counters</category>
<short>System information</short>
<long>System information related counters</long>
</ns2:category>
<ns2:category>
<id>counters_vz_slm</id>
<category>virtuozzo</category>
<category>counters</category>
<short>New SLM parameters</short>
</ns2:category>
<ns2:category>
<id>counters_vz_memory</id>
<category>virtuozzo</category>
<category>counters</category>
<short>Memory usage</short>
</ns2:category>
<ns2:category>
<id>counters_vz_hw_net</id>
<category>generic</category>
<category>counters</category>
<postfix>virtuozzo</postfix>
<short>Virtuozzo network usage</short>
<long>Network related counters</long>
</ns2:category>
</ns2:vocabulary>
<!-- Generic classes -->
<ns2:vocabulary>
<ns2:name>generic</ns2:name>
<ns2:category>
<id>counters_cpu</id>
<category>generic</category>
<category>counters</category>
<short>CPU usage</short>
<long>Hardware Node CPU related parameters</long>
</ns2:category>
<ns2:category>
<id>counters_disk</id>
<category>generic</category>
<category>counters</category>
<short>Disk usage</short>
<long>Disk usage related parametres</long>
</ns2:category>
<ns2:category>
<id>counters_memory</id>
<category>generic</category>
<category>counters</category>
<short>Memory usage</short>
<long>Memory usage related parametres</long>
</ns2:category>
<ns2:category>
<id>counters_net</id>
<category>generic</category>
<category>counters</category>
<short>Network usage</short>
<long>Network usage related parametres</long>
</ns2:category>
<ns2:category>
<id>counters_loadavg</id>
<category>generic</category>
<category>counters</category>
<short>Load average</short>
<long>CPU usage related parametres</long>
</ns2:category>
<ns2:category>
<id>counters_process</id>
<category>generic</category>
<category>counters</category>
<short>Process info</short>
<long>Process info related parametres</long>
</ns2:category>
<ns2:category>
<id>counters_system</id>
<category>generic</category>
<category>counters</category>
<short>System info</short>
<long>System info related parametres</long>
</ns2:category>
</ns2:vocabulary>
</ns1:system>
</ns1:data>
</ns1:packet>
Getting a list of counters for the specified class
To retrieve the list of counters for a class, use the following request passing the class ID as a parameter. In this example, we are retrieving the list of counters for the counters_vz_cpu
class.
Input
<packet version="4.0.0">
<data>
<system>
<get_vocabulary>
<category>counters_vz_cpu</category>
</get_vocabulary>
</system>
</data>
</packet>
Output
<ns1:packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/system" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="ec45f7fc01t26e9r4e4" priority="0" version="4.0.0">
<ns1:origin>gend</ns1:origin>
<ns1:target>vzclient8</ns1:target>
<ns1:dst>
<ns1:director>gend</ns1:director>
</ns1:dst>
<ns1:data>
<ns1:system>
<ns2:vocabulary>
<ns2:name>VZABasicFunctionality</ns2:name>
<ns2:parameter>
<id>counter_cpu_system</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>2</counter_type>
<short>System</short>
<long>System CPU time</long>
<measure>seconds</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_user</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>2</counter_type>
<short>User</short>
<long>User CPU time</long>
<measure>seconds</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_idle</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>2</counter_type>
<short>Idle</short>
<long>Idle CPU time</long>
<measure>seconds</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_nice</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>2</counter_type>
<short>Nice</short>
<long>Nice CPU time</long>
<measure>seconds</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_starvation</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>2</counter_type>
<short>Starvation</short>
<long>Starvation CPU time (Difference between guaranteed CPU time and used CPU time)</long>
<measure>seconds</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_system_states</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>0</counter_type>
<short>System states</short>
<long>System CPU time (percents)</long>
<measure>percents</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_user_states</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>0</counter_type>
<short>Use statesr</short>
<long>User CPU time (percents)</long>
<measure>percents</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_idle_states</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>0</counter_type>
<short>Idle states</short>
<long>Idle CPU time (percents)</long>
<measure>percents</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_nice_states</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>0</counter_type>
<short>Nice states</short>
<long>Nice CPU time (percents)</long>
<measure>percents</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_starvation_states</id>
<category>counters_vz_cpu</category>
<type>int</type>
<value_type>1</value_type>
<counter_type>0</counter_type>
<short>Starvation states</short>
<long>Starvation CPU time (Difference between guaranteed CPU time and used CPU time) (percents)</long>
<measure>percents</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_used</id>
<category>counters_vz_cpu</category>
<category>top_counters</category>
<type>float</type>
<value_type>0</value_type>
<counter_type>0</counter_type>
<short>CPU used</short>
<long>Total CPU usage (percents)</long>
<measure>percents</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_share_used</id>
<category>counters_vz_cpu</category>
<category>top_counters</category>
<type>float</type>
<value_type>0</value_type>
<counter_type>0</counter_type>
<short>CPU share used</short>
<long>The ratio of CPU time consumed by environment to current limit (percents)</long>
<measure>percents</measure>
</ns2:parameter>
<ns2:parameter>
<id>counter_cpu_limit</id>
<category>counters_vz_cpu</category>
<type>float</type>
<value_type>0</value_type>
<counter_type>0</counter_type>
<short>CPU Limit</short>
<long>CPU limit of the share the Environment will get</long>
<measure>percents</measure>
</ns2:parameter>
</ns2:vocabulary>
</ns1:system>
</ns1:data>
</ns1:packet>