docs: private static void respondAsciiQuery(final HttpQuery query,
                                          final int max_age,
                                          final String basepath,
                                          final Plot plot) {
      final String path = basepath + ".txt";
      PrintWriter asciifile;
      try {
        asciifile = new PrintWriter(path);
      } catch (IOException e) {
        query.internalError(e);
        return;
      }
      try {
        final StringBuilder tagbuf = new StringBuilder();
        for (final DataPoints dp : plot.getDataPoints()) {
          final String metric = dp.metricName();
          tagbuf.setLength(0);
          for (final Map.Entry<String, String> tag : dp.getTags().entrySet()) {
            tagbuf.append(' ').append(tag.getKey())
              .append('=').append(tag.getValue());
          }
          for (final DataPoint d : dp) {
            if (d.isInteger()) {
              printMetricHeader(asciifile, metric, d.timestamp());
              asciifile.print(d.longValue());
            } else {
              // Doubles require extra processing.
              final double value = d.doubleValue();
  
              // Value might be NaN or infinity.
              if (Double.isInfinite(value)) {
                // Infinity is invalid.
                throw new IllegalStateException("Infinity:" + value
                  + " d=" + d + ", query=" + query);
              } else if (Double.isNaN(value)) {
                // NaNs should be skipped.
                continue;
              }
  
              printMetricHeader(asciifile, metric, d.timestamp());
              asciifile.print(value);
            }
  
            asciifile.print(tagbuf);
            asciifile.print('\n');
          }
        }
      } finally {
        asciifile.close();
      }
      try {
        query.sendFile(path, max_age);
      } catch (IOException e) {
        query.internalError(e);
      }
    }