Hi,
I'm querying a Virtual Center for a set of Performance Metrics for multiple MORs through Java. I'm trying to determine what are the most efficient ways.
The MORs are all the Virtual Machines belonging to one host. I'm probing for the most recent sample of 20 seconds, which I understand goes to the host directly since the time interval is less than the past 30 minutes (though I can't understand why that'd be more efficient than getting the stats from the VC database).
I have done it in 2 ways:
1. Calling service.queryPerf() multiple times, with a unique PerfQuerySpec each time which has a list of metrics and a MOR I'm interested in.
2. Calling service.queryPerf() one time, passing it a list of unique PerfQuerySpecs - one for each MOR with the same list of metrics in each PerfQuerySpec.
The strange thing is that doing it either way resulted in the same speed. I would have thought that option 2 would have been faster, but I'm starting to think providing it an array of PerfQuerySpecs is just a convenience, and it just loops through them and does the same thing as option 1....
Also, to speed up performance metrics gathering, I have seen in the Best Practices webinar that it's a good idea to split the requests into multiple threads. Would it be best to split all metrics gatherings into separate batches by hosts and items lower in the hierarchy (like the VMs that belong to a host), since probing the VC for a time interval of less than 30 minutes probes the hosts?
Tags:
java,
sdk,
webservices,
api