@Override
  public void sampled(long nanosTimeStamp, List<ResourceInstance> resourceInstances) {
    if (logger.isTraceEnabled(LogMarker.STATISTICS_VERBOSE)) {
      logger.trace(LogMarker.STATISTICS_VERBOSE,
          "StatArchiveWriter#sampled nanosTimeStamp={}, resourceInstances={}", nanosTimeStamp,
          resourceInstances);
    }
    try {
      dataOut.writeByte(SAMPLE_TOKEN);
      if (trace) {
        traceDataOut.println("sampled#writeByte SAMPLE_TOKEN: " + SAMPLE_TOKEN);
      }
      writeTimeStamp(nanosTimeStamp);
      for (ResourceInstance ri : resourceInstances) {
        writeSample(ri);
        ri.setPreviousStatArchiveValues(ri.getLatestStatArchiveValues());
      }
      writeResourceInst(ILLEGAL_RESOURCE_INST_ID);
      dataOut.flush();
      if (trace) {
        traceDataOut.flush();
      }
    } catch (IOException ex) {
      throw new GemFireIOException(
          "Failed writing sample to statistic archive",
          ex);
    }
    sampleCount++; // only inc after sample done w/o an exception thrown
  }
Writes the resource instance id to the <code>dataOut</code> stream.
geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java