@Override
  public void destroyedResourceInstance(ResourceInstance resourceInstance) {
    if (logger.isTraceEnabled(LogMarker.STATISTICS_VERBOSE)) {
      logger.trace(LogMarker.STATISTICS_VERBOSE,
          "StatArchiveWriter#destroyedResourceInstance resourceInstance={}", resourceInstance);
    }
    if (!addedResources.contains(resourceInstance)) { // Fix for bug #45377
      return;
    }

    sampleWrittenForResources.remove(resourceInstance);
    addedResources.remove(resourceInstance);

    try {
      dataOut.writeByte(RESOURCE_INSTANCE_DELETE_TOKEN);
      dataOut.writeInt(resourceInstance.getId());
      if (trace
          && (traceStatisticsName == null
              || traceStatisticsName.equals(resourceInstance.getStatistics().getTextId()))
          && (traceStatisticsTypeName == null || traceStatisticsTypeName
              .equals(resourceInstance.getResourceType().getStatisticsType().getName()))) {
        traceDataOut
            .println("destroyedResourceInstance#writeByte RESOURCE_INSTANCE_DELETE_TOKEN: "
                + RESOURCE_INSTANCE_DELETE_TOKEN);
        traceDataOut.println("destroyedResourceInstance#writeInt resourceInstance.getId(): "
            + resourceInstance.getId());
      }
    } catch (IOException ex) {
      throw new GemFireIOException(
          "Failed writing delete resource instance to statistic archive",
          ex);
    }
  }
Returns the number of bytes written so far to this archive. This does not take compression into
account.
geode-core/src/main/java/org/apache/geode/internal/statistics/StatArchiveWriter.java