ManagedObjectReference vmMor = hyperHost.findVmOnHyperHost(name).getMor();
assert (vmMor != null);
ArrayList<PerfMetricId> vmNetworkMetrics = new ArrayList<PerfMetricId>();
// get all the metrics from the available sample period
List<PerfMetricId> perfMetrics = service.queryAvailablePerfMetric(perfMgr, vmMor, null, null, null);
if (perfMetrics != null) {
for (int index = 0; index < perfMetrics.size(); ++index) {
if (((rxPerfCounterInfo != null) && (perfMetrics.get(index).getCounterId() == rxPerfCounterInfo.getKey())) ||
((txPerfCounterInfo != null) && (perfMetrics.get(index).getCounterId() == txPerfCounterInfo.getKey()))) {
vmNetworkMetrics.add(perfMetrics.get(index));