I have one VM having 2 CPUs, cpu0 and cpu1. I am able to see the perf data thru VI client for the same VM . I am using below given code for getting real time data. Using Java APIs.
metrics = vmware.getService().queryAvailablePerfMetric(pmRef,vmMor,null,null,new Integer(20));
PerfQuerySpec qSpecObj = new PerfQuerySpec();
qSpecObj.setEntity(mor);
qSpecObj.setMaxSample(new Integer(1));
qSpecObj.setMetricId(metrics);
qSpecObj.setIntervalId(new Integer(20));
qSpecList.add(qSpecObj);
PerfQuerySpec[] qSpec = (PerfQuerySpec[])qSpecList.toArray(new PerfQuerySpec[http://qSpecList.size()|http://qSpecList.size()]);
pValues = vmware.getServiceRef().queryPerf(pmRef, qSpec);
but when I parse this pValues set . I am able to get the stats data for cpu0 but not for cpu1.
Is anything wrong with this code ? or Do I need to do something more ? Am I missing anything ?
Same is happening with disk instance . I am not able to get stats data for vmhba1:0:0.
Thanks in Advance.
You can find out more by calling QueryAvailablePerfMetric() method. It should give you an array of PerfMetricId object. From there you can examine in details.
Steve JIN, VMware Engineering
Creator of VMware Infrastructure Java API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute your applications. (Download, Samples, DocWiki, RSS Feed)
Get Connected with Other Developers in the Community?
Yes steve. I am using that API only first to get complete metrics available and as is I am setting to perfqueryspec object for each MOR but still I am getting data only for cpu0 not for cpu1. Same is happening with Hosts also like if in a host there are 16 cpu threads I am getting data only for 8 cpu(0-7) instances. So is anything more I am supposed to do ? or I am not able to understand the data which I am getting as result of executing queryPerf() ?
Thanks,
Deepak
thanks !