code: public static void writeStats(final String path, final String statLabel, final long stat) {
          BufferedWriter out = null;
          try {
              out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path, true), "UTF-8"));
              out.write(statLabel + "\t" + stat + "\n");
              out.flush();
              out.close();
          } catch (IOException e) {
              e.printStackTrace();
          } finally {
              if (out != null) {
                  try {
                      out.close();
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
          }
      }
docs: Write the system stats to file.
  
  @param path the path to write to
  @param statLabel what statistics is being written
  @param stat the value