}
return null;
}
private PlatformMetricsSummary createSummary(Resource resource, Set<MeasurementData> measurementDataSet) {
PlatformMetricsSummary summary = new PlatformMetricsSummary();
summary.setResource(resource);
if (null == measurementDataSet || measurementDataSet.isEmpty()) {
summary.setMetricsAvailable(false);
} else {
summary.setIdleCPU(findMeasurementData(measurementDataSet, CPUMetric.Idle.getProperty()));
summary.setSystemCPU(findMeasurementData(measurementDataSet, CPUMetric.System.getProperty()));
summary.setUserCPU(findMeasurementData(measurementDataSet, CPUMetric.User.getProperty()));
summary.setFreeMemory(findMeasurementData(measurementDataSet, MemoryMetric.Free.getProperty()));
summary.setActualFreeMemory(findMeasurementData(measurementDataSet, MemoryMetric.ActualFree.getProperty()));
summary.setUsedMemory(findMeasurementData(measurementDataSet, MemoryMetric.Used.getProperty()));
summary.setActualUsedMemory(findMeasurementData(measurementDataSet, MemoryMetric.ActualUsed.getProperty()));
summary.setTotalMemory(findMeasurementData(measurementDataSet, MemoryMetric.Total.getProperty()));
summary.setFreeSwap(findMeasurementData(measurementDataSet, SwapMetric.Free.getProperty()));
summary.setTotalSwap(findMeasurementData(measurementDataSet, SwapMetric.Total.getProperty()));
summary.setUsedSwap(findMeasurementData(measurementDataSet, SwapMetric.Used.getProperty()));
}
return summary;
}