code: protected void recordSerializeRequest(RequestCommand requestCommand, InvokeContext invokeContext) {
          if (!RpcInternalContext.isAttachmentEnable()) {
              return;
          }
          RpcInternalContext context = null;
          if (invokeContext != null) {
              // 客户端异步调用的情况下，上下文会放在InvokeContext中传递
              context = invokeContext.get(RemotingConstants.INVOKE_CTX_RPC_CTX);
          }
          if (context == null) {
              context = RpcInternalContext.getContext();
          }
          int cost = context.getStopWatch().tick().read();
          int requestSize = RpcProtocol.getRequestHeaderLength()
              + requestCommand.getClazzLength()
              + requestCommand.getContentLength()
              + requestCommand.getHeaderLength();
          // 记录请求序列化大小和请求序列化耗时
          context.setAttachment(RpcConstants.INTERNAL_KEY_REQ_SIZE, requestSize);
          context.setAttachment(RpcConstants.INTERNAL_KEY_REQ_SERIALIZE_TIME, cost);
      }
docs: 客户端记录序列化请求的耗时和
  
  @param requestCommand 请求对象