/** * Tests explode function */ public function testExplodeByMtu() { $messages = [str_repeat('a', 22), str_repeat('b', 22), str_repeat('c', 22)]; $batches = SocketHandler::explodeByMtu($messages, 50); $this->assertCount(2, $batches); $this->assertCount(2, $batches[0]); $this->assertCount(1, $batches[1]); }
/** * Creates new instance of InfluxDbUdpHandler * * @param string $host * @param int $port * @param int $timeout * @param int $mtu */ public function __construct($host = '127.0.0.1', $port = 4444, $timeout = 5, $mtu = 1432) { parent::__construct($host, $port, $timeout, 'udp', $mtu); $this->formatter = new InfluxDbLineFormatter(); }
/** * Creates new instance of StatsDaemonHandler * * @param string $host * @param int $port * @param int $timeout * @param string $scheme * @param int $mtu */ public function __construct($host = '127.0.0.1', $port = 8125, $timeout = 5, $scheme = 'udp', $mtu = 1432) { parent::__construct($host, $port, $timeout, $scheme, $mtu); $this->formatter = new StatsDaemonFormatter(); }