code: public void updateImpl(List<Metric> metrics) {
      Preconditions.checkNotNull(metrics, "metrics");
      File file = new File(dir, fileFormat.format(new Date(clock.now())));
      Writer out = null;
      try {
        try {
          LOGGER.debug("writing {} metrics to file {}", metrics.size(), file);
          OutputStream fileOut = new FileOutputStream(file, true);
          if (compress) {
            fileOut = new GZIPOutputStream(fileOut);
          }
          out = new OutputStreamWriter(fileOut, "UTF-8");
          for (Metric m : metrics) {
            out.append(m.getConfig().getName()).append('\t')
                .append(m.getConfig().getTags().toString()).append('\t')
                .append(m.getValue().toString()).append('\n');
          }
        } catch (Throwable t) {
          if (out != null) {
            out.close();
            out = null;
          }
          throw Throwables.propagate(t);
        } finally {
          if (out != null) {
            out.close();
          }
        }
      } catch (IOException e) {
        incrementFailedCount();
        LOGGER.error("failed to write update to file " + file, e);
      }
    }
docs: {@inheritDoc}