36 lines
939 B
PHP
36 lines
939 B
PHP
<?php
|
|
|
|
|
|
namespace InfluxDB2;
|
|
|
|
interface Writer
|
|
{
|
|
|
|
/**
|
|
* Write data
|
|
*
|
|
* Example write data in array
|
|
* $writeApi->write([
|
|
* ['name' => 'cpu','tags' => ['host' => 'server_nl', 'region' => 'us'],
|
|
* 'fields' => ['internal' => 5, 'external' => 6],
|
|
* 'time' => 1422568543702900257],
|
|
* ['name' => 'gpu', 'fields' => ['value' => 0.9999]]],
|
|
* WritePrecision::NS,
|
|
* 'my-bucket',
|
|
* 'my-org'
|
|
* )
|
|
*
|
|
* Example write data in line protocol
|
|
* $writeApi->write('h2o,location=west value=33i 15')
|
|
*
|
|
* Example write data using Point structure
|
|
* $point = new Point("h2o).
|
|
*
|
|
*
|
|
* @param string|Point|array $data DataPoints to write into InfluxDB. The data could be represent by
|
|
* array, Point, string
|
|
* @throws \Throwable
|
|
*/
|
|
public function write($data);
|
|
}
|