Skip to content

Commit

Permalink
reuse udp client
Browse files Browse the repository at this point in the history
  • Loading branch information
jky-yy committed Mar 20, 2019
1 parent df97620 commit 7e75e3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Jaeger/Transport/TransportUdp.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ public function flush(){
}

$spanNum = 0;
$udp = new UdpClient(self::$hostPort);

foreach (self::$batchs as $batch){
$spanNum += count($batch['thriftSpans']);
$udp = new UdpClient(self::$hostPort);
$udp->emitBatch($batch);
$udp->close();
}

$udp->close();
$this->resetBuffer();

return $spanNum;
}
}

0 comments on commit 7e75e3d

Please sign in to comment.