private void processForUnicast(Message msg, int direction) {
    Object o = msg.getHeader(unicastHeaderId);
    if (o instanceof UNICAST3.Header && stats != null) {
      UNICAST3.Header hdr = (UNICAST3.Header) o;
      switch (direction) {
        case INCOMING:
          stats.incUcastReadBytes((int) msg.size());
          break;
        case OUTGOING:
          stats.incUcastWriteBytes((int) msg.size());
          switch (hdr.type()) {
            case UNICAST3.Header.XMIT_REQ:
              stats.incUcastRetransmits();
              break;
          }
          break;
      }
    }
  }
sets the services object of the GMS that is using this recorder

@param services the Services collective of the GMS
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/StatRecorder.java