/** * {@inheritDoc} */ public function flush() { foreach ($this->data as $data) { $this->client->mark($data[0], array('value' => $data[1])); } $this->data = array(); }
/** * {@inheritdoc} */ public function flush() { foreach ($this->data as $data) { $this->client->mark(array('points' => array(array('measurement' => $data[0], 'fields' => array('value' => $data[1]))), 'tags' => $this->tags)); } $this->data = array(); }
/** * Test that we handle socket problems correctly in the UDP * adapter, and that they don't inturrupt the user's application. * * @group udp */ public function testReplicateIssue27() { $options = new \InfluxDB\Options(); // Configure options $options->setHost('172.16.1.182'); $options->setPort(4444); $options->setDatabase('...'); $options->setUsername('root'); $options->setPassword('root'); $httpAdapter = new \InfluxDB\Adapter\UdpAdapter($options); $client = new \InfluxDB\Client($httpAdapter); $client->mark("udp.test", ["mark" => "element"]); }
/** * @group udp */ public function testWriteUDPPackagesToInvalidHostname() { $options = new Options(); $options->setHost("www.test-invalid.this-is-not-a-tld"); $options->setUsername("nothing"); $options->setPassword("nothing"); $options->setPort(15984); $adapter = new UdpAdapter($options); $object = new Client($adapter); $object->mark("udp.test", ["mark" => "element"]); }
/** * @expectedException BadMethodCallException */ public function testNeedWritableInterfaceDuringMark() { $client = new Client(new \stdClass()); $client->mark("OK", []); }