use of com.vmware.vim25.ArrayOfPerfCounterInfo in project photon-model by vmware.
the class StatsClient method createLookup.
/**
* cache perfCounters per connections. The call is slow as the response can be about 400kb
* of xml.
* @param conn
* @return
*/
private static PerfCounterLookup createLookup(Connection conn) {
return lookups.computeIfAbsent(conn.getURI(), u -> {
GetMoRef get = new GetMoRef(conn);
ArrayOfPerfCounterInfo counters;
try {
counters = get.entityProp(PERF_MGR_MOREF, PROP_PERF_COUNTER);
} catch (Exception e) {
throw new RuntimeException("cannot create lookup for " + u, e);
}
return new PerfCounterLookup(counters.getPerfCounterInfo());
});
}
Aggregations