code: public boolean sendSample(SampleMessage sampleMessage) {
      if (!this.canSendSamples) {
        log.warn("Cannot send samples.");
        return false;
      }
  
      if (this.session.getScheduledWriteMessages() > this.maxOutstandingSamples) {
        log.warn("Buffer full, cannot send sample.");
        return false;
      }
      this.session.write(sampleMessage);
      return true;
    }
docs: Sends a sample to the aggregator.
  
  @param sampleMessage
  the sample to send
  @return {@code true} if the sample was written, else {@code false}.