MeasurementDefinition measurementDefinition = ResourceTypeUtility.getMeasurementDefinition(resourceType,
metricName);
assertNotNull(measurementDefinition, "No metric named [" + metricName + "] is defined for ResourceType {"
+ resourceType.getPlugin() + "}" + resourceType.getName() + ".");
ResourceContainer resourceContainer = this.pluginContainer.getInventoryManager().getResourceContainer(resource);
long timeoutMillis = 5000;
if (resourceContainer.getResourceComponentState() != ResourceContainer.ResourceComponentState.STARTED) {
throw new IllegalStateException("Resource component for " + resource + " has not yet been started.");
}
MeasurementFacet measurementFacet = resourceContainer.createResourceComponentProxy(MeasurementFacet.class,
FacetLockType.READ, timeoutMillis, false, false, false);
MeasurementReport report = new MeasurementReport();
MeasurementScheduleRequest request = new MeasurementScheduleRequest(-1, metricName, -1, true,
measurementDefinition.getDataType(), measurementDefinition.getRawNumericType());
Set<MeasurementScheduleRequest> requests = new HashSet<MeasurementScheduleRequest>();