public static void extractMetricsFromJmxJson(InputStream jmxStream, String jmxUrl,
Map<String, String> jmxProperties,
Map<String, Metric> metrics)
throws IOException, ParseException {
JSONParser parser = new JSONParser();
Object obj = parser.parse(IOUtils.toString(jmxStream));
JSONObject jsonObject = (JSONObject) obj;
for (String key : metrics.keySet()) {
Metric metric = metrics.get(key);
String jsonKey = extractJsonKeySingleLevel(metric.getMetric());
Object value = jsonObject.get(jsonKey);