code: 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);
          }
      }
docs: Returns the given memory metric's value.
  
  @param metricToCollect the metric to collect
  @return the value of the metric