code: protected function queue($data, $sampleRate = 1)
      {
          if ($sampleRate < 1) {
              foreach ($data as $stat => $value) {
                  $data[$stat] = "$value|@$sampleRate";
              }
          }
          foreach ($data as $stat => $value) {
              $msg = "$this->prefix.$stat:$value";
              if ($this->queueSize + strlen($msg) > $this->packetSize) {
                  $this->flush();
              }
              $this->queue[] = $msg;
              $this->queueSize += strlen($msg) + 1;
          }
          if ($this->alwaysFlush) {
              $this->flush();
          }
      }
docs: queues data
  
  @param array $data
  @param int   $sampleRate