private MetricRegistry loadMetrics(MetricRegistry metricsRegistry, String directoryPath) {
        File metricsFile = new File(directoryPath + "/metrics/metrics_counters.data");
        if (metricsFile.exists()) {
            try {
                BufferedReader reader = new BufferedReader(new FileReader(metricsFile));
                String line = null;
                while ((line = reader.readLine()) != null) {
                    String[] input = line.split(":");
                    Counter counter = metricsRegistry.counter(input[0]);
                    counter.inc(Integer.parseInt(input[1]));
                }
                reader.close();
            } catch (Exception e) {
                logger.error("Unable to deserialize counters : " + e.getMessage());
            }
        }
        return metricsRegistry;
    }
Loads metrics from the file at the directory path

@param metricsRegistry
@param directoryPath
@return
@throws IOException
ache/src/main/java/achecrawler/util/MetricsManager.java