コード例 #1
0
ファイル: Client.php プロジェクト: vend/statsd
 public function flush()
 {
     $this->socket->open();
     $metrics = array_map(function (MetricInterface $metric) {
         return $metric->getData();
     }, $this->queue);
     $packets = $this->fillPackets($metrics);
     foreach ($packets as $packet) {
         $this->socket->write($packet);
     }
     $this->queue = [];
     $this->socket->close();
 }