private int getCounterValue(String name) throws FileNotFoundException {
    JsonParser parser = new JsonParser();
    JsonElement element = parser.parse(new FileReader(jsonReportFile.getAbsolutePath()));
    JsonObject jobj = element.getAsJsonObject();
    jobj = jobj.getAsJsonObject("counters").getAsJsonObject(name);
    return jobj.get("count").getAsInt();
  }
Read counter value from JSON metric report
@param name counter name
@return counter value
@throws FileNotFoundException if file doesn't exist
standalone-metastore/metastore-common/src/test/java/org/apache/hadoop/hive/common/metrics/metrics2/TestCodahaleMetrics.java