VMware {code} Community
maciej_wos
Contributor
Contributor

Performance intervals and performance counters/metrics

I'm writting performance monitoring scripts and I'm not sure I completely follow how things are done in the SDK.

The call to QueryAvailablePerfMetric returns the PerfMetricId array with metrics corresponding to active counters - and here comes my question - how do I \*register* counter with an entity so i will have its information available.

For example there's CPU running average over last 15 minutes counter and I think I would find it very usable, but I don't know how to start it.

Also the performance intervals... the QueryPerf returns samples for only one performance interval - the smallest one. How do I specify the performance interval I want?

Reply
0 Kudos
4 Replies
tmilner
Enthusiast
Enthusiast

Marcie,

VMware supplies a number of counters which work with various managed objects. The list of available counters and their description can be dumped out from a VC or ESX system and it looks like the following:

http://nworks.com/vmware/vcmetrics.xml

Next you will need a Managed Object to query; a host, VM, Resource Pool, etc. You can either get a full inventory or use one of the "findBy.." calls to get a ManagedObjectReference.

Then select the intervals you want based upon time range. VMware keeps 20-second and 5-minute intervals running constantly, so you just need to pick the time frame you want (the intervals start at the top of the hour btw, like 11:00, 11:05, 11:10, etc.).

You put this all together and issue a QueryPerf call.

Tom

Reply
0 Kudos
maciej_wos
Contributor
Contributor

Thank you, but still there are some issues with counters and performance data i dont understand...

Below is the weird performance data I am receiving.

>>> len(res[0].sampleInfo) \*number of samples returned*

7819

>>> res[0].sampleInfo[0].timestamp

Or getting data on \*undefined* intervals. It seems that creating intervals is pointless and does not do anything. Anyone has similiar experiences?

Reply
0 Kudos
Ray_M
Contributor
Contributor

Where can we find documentation on dumping counters and their descriptions out from a VC or ESX system?

Ray

Reply
0 Kudos
ssurana
VMware Employee
VMware Employee

Hi Ray,

As far as documentation for the Performance counters is related, you can refer to the following URL http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.PerformanceManager.htm...

If you scroll down to the "Performance Counter Values" section you can get the definition of all the possible counters. This page would provide you the complete insight on the Performance counters.

Do let us know if there is any doubt regarding the same. We shall try to resolve those doubts if any.

~ Sidharth

Reply
0 Kudos