docs: byte[] pickleMetrics(List<MetricTuple> metrics) throws IOException {
          // Extremely rough estimate of 75 bytes per message
          ByteArrayOutputStream out = new ByteArrayOutputStream(metrics.size() * 75);
          Writer pickled = new OutputStreamWriter(out, charset);
  
          pickled.append(MARK);
          pickled.append(LIST);
  
          for (MetricTuple tuple : metrics) {
              // start the outer tuple
              pickled.append(MARK);
  
              // the metric name is a string.
              pickled.append(STRING);
              // the single quotes are to match python's repr("abcd")
              pickled.append(QUOTE);
              pickled.append(tuple.name);
              pickled.append(QUOTE);
              pickled.append(LF);
  
              // start the inner tuple
              pickled.append(MARK);
  
              // timestamp is a long
              pickled.append(LONG);
              pickled.append(Long.toString(tuple.timestamp));
              // the trailing L is to match python's repr(long(1234))
              pickled.append(LONG);
              pickled.append(LF);
  
              // and the value is a string.
              pickled.append(STRING);
              pickled.append(QUOTE);
              pickled.append(tuple.value);
              pickled.append(QUOTE);
              pickled.append(LF);
  
              pickled.append(TUPLE); // inner close
              pickled.append(TUPLE); // outer close
  
              pickled.append(APPEND);
          }
  
          // every pickle ends with STOP
          pickled.append(STOP);
  
          pickled.flush();
  
          return out.toByteArray();
      }