public Double getMemoryMetric ( ID metricToCollect ) { GlobalMemory mem = getMemory ( ) ; if ( PlatformMetricType . MEMORY_AVAILABLE . getMetricTypeId ( ) . equals ( metricToCollect ) ) { return Double . valueOf ( mem . getAvailable ( ) ) ; } else if ( PlatformMetricType . MEMORY_TOTAL . getMetricTypeId ( ) . equals ( metricToCollect ) ) { return Double . valueOf ( mem . getTotal ( ) ) ; } else { throw new UnsupportedOperationException ( "Invalid memory metric to collect: " + metricToCollect ) ; } }
Returns the given memory metric s value .