Now that you know what classes, instances, and counters are, you a ready to use Performance Monitor. In this section, we will retrieve a single on-demand performance report. In the section that follows, we will use the monitor to receive periodic reports.
The first thing that you have to do is select the performance aspect that you would like to monitor. You do that by selecting the name of the class and the name(s) of the counters from the vocabulary. Let's say that we want to get the current network usage by a Virtuozzo Container. The name of the class is counters_vz_net
. The names of the counters are counter_net_incoming_bytes
and counter_net_outgoing_bytes
. The request, therefore, will look similar to the following:
<packet version="4.0.0" id="2">
<target>perf_mon</target>
<data>
<perf_mon>
<get>
<eid_list>
<eid>6d7d3a7c-b7a7-3745-b7cb-0e56205120a1</eid>
</eid_list>
<class>
<name>counters_vz_net</name>
<instance>
<counter>counter_net_incoming_bytes</counter>
<counter>counter_net_outgoing_bytes</counter>
</instance>
</class>
</get>
</perf_mon>
</data>
</packet>
Output
<?xml version="1.0" encoding="UTF-8"?><packet xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/types" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/perf_mon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.0.0" priority="0" id="5c47838ee6t3d6cre0" time="2008-01-08T14:55:36+0000">
<origin>perf_mon</origin>
<target>vzclient19-c56d51ed-cb1c-fa4c-b131-3115d3700c68</target>
<dst>
<director>gend</director>
</dst>
<data>
<perf_mon>
<data xsi:type="ns2:perf_dataType">
<eid>6d7d3a7c-b7a7-3745-b7cb-0e56205120a1</eid>
<interval xsi:type="ns2:intervalType">
<start_time>2008-01-08T14:55:06+0000</start_time>
<end_time>2008-01-08T14:55:26+0000</end_time>
</interval>
<class>
<name>counters_vz_net</name>
<instance>
<name>0</name>
<counter>
<name>counter_net_incoming_bytes</name>
<value>
<avg>0</avg>
<min>0</min>
<max>0</max>
<cur>0</cur>
</value>
</counter>
<counter>
<name>counter_net_outgoing_bytes</name>
<value>
<avg>0</avg>
<min>0</min>
<max>0</max>
<cur>0</cur>
</value>
</counter>
</instance>
<instance>
<name>1</name>
<counter>
<name>counter_net_incoming_bytes</name>
<value>
<avg>0</avg>
<min>0</min>
<max>0</max>
<cur>0</cur>
</value>
</counter>
<counter>
<name>counter_net_outgoing_bytes</name>
<value>
<avg>0</avg>
<min>0</min>
<max>0</max>
<cur>0</cur>
</value>
</counter>
</instance>
</class>
</data>
</perf_mon>
</data>
<src>
<director>gend</director>
</src>
</packet>